Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing #1227: documentation of UniqueItems #1424

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions website/pages/docs/validators/tags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ For reference, when you take a mistake that choosing different target type, Type
- `duration`
- `json-pointer`
- `relative-json-pointer`
- array
- `Array<T> & MinItems<{number}>`
- `Array<T> & MaxItems<{number}>`
- `Array<T> & UniqueItems`

Also, if you need custom validation logic, just make it by yourself referencing [Customization](#customization) section. It is easy to define. For such type safety and generous use case reasons even customization supporting, I recommend you to use type tags instead of [comment tags](#comment-tags), unless you are maintaining a legacy JSDoc styled project.

Expand Down Expand Up @@ -341,6 +345,7 @@ Here is the entire list of comment tags that `typia` supports.
- array
- `@minItems {number}`
- `@maxItems {number}`
- `@uniqueItems`

By the way, I do not recommend this way, because it can't perform union numeric types, and can be used for only object property type. It can't be used standalone, and cannot be used for element type of `Array` and `Map` even when they're declared on object property. Also, When you declare `@type int32` statement, target `number` type be fixed as `int32` type, and never can have another numeric type by declaring union statements.

Expand Down