From afbe38893d4c8edf484b05728f4c041ca8d2a517 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Thu, 12 Dec 2024 03:26:53 +0900 Subject: [PATCH] Fixing #1227: documentation of `UniqueItems` --- website/pages/docs/validators/tags.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/pages/docs/validators/tags.mdx b/website/pages/docs/validators/tags.mdx index 4f823df379..7afb6b04d8 100644 --- a/website/pages/docs/validators/tags.mdx +++ b/website/pages/docs/validators/tags.mdx @@ -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 & MinItems<{number}>` + - `Array & MaxItems<{number}>` + - `Array & 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. @@ -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.