Skip to content

Commit

Permalink
Merge pull request #1424 from samchon/doc/tags
Browse files Browse the repository at this point in the history
Fixing #1227: documentation of `UniqueItems`
  • Loading branch information
samchon authored Dec 11, 2024
2 parents a440e40 + afbe388 commit 1513744
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 1513744

Please sign in to comment.