ArrayOfChainedDecorators
Usage
import { ArrayOfChainedDecorators } from "@tsed/schema";
See /packages/specs/schema/src/types/decorators/collections/collectionOf.ts.
Overview
interface ArrayOfChainedDecorators {
(...args: any): any;
MinItems(minItems: number): this;
MaxItems(maxItems: number): this;
Contains(): this;
UniqueItems(uniqueItems?: boolean): this;
}
(...args: any): any;
MinItems
MinItems(minItems: number): this;
An array instance is valid against minItems
if its size is greater than, or equal to, the value of this keyword.
WARNING
The value minItems
MUST be a non-negative integer.
TIP
Omitting this keyword has the same behavior as a value of 0.
MaxItems
MaxItems(maxItems: number): this;
The value maxItems
MUST be a non-negative integer.
An array instance is valid against maxItems
if its size is less than, or equal to, the value of this keyword.
:: warning The value maxItems
MUST be a non-negative integer. :::
Contains
Contains(): this;
Set the type of the item collection. The possible value is String, Boolean, Number, Date, Object, Class, etc...
The array instance will be valid against "contains" if at least one of its elements is valid against the given schema.
UniqueItems
UniqueItems(uniqueItems?: boolean): this;
If this keyword has boolean value false, the instance validates successfully. If it has boolean value true, the instance validates successfully if all of its elements are unique.