@tsed/common
Version:
A TypeScript Framework on top of Express
56 lines • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MaxItems = void 0;
const schema_1 = require("@tsed/schema");
/**
* 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.
* :::
*
* :: warning
* This decorator will be removed in v7.
* For v6 user, use @@MaxItems@@ from @tsed/schema instead of @tsed/common.
* :::
*
* ## Example
*
* ```typescript
* class Model {
* @CollectionOf(String)
* @MaxItems(10)
* property: string[];
* }
* ```
*
* Will produce:
*
* ```json
* {
* "type": "object",
* "properties": {
* "property": {
* "type": "number",
* "maxItems": 10
* }
* }
* }
* ```
*
* @param {number} maxItems
* @decorator
* @validation
* @swagger
* @schema
* @collections
* @ignore
* @deprecated Since v6. Use @MaxItems decorator from @tsed/schema instead of.
*/
function MaxItems(maxItems) {
return schema_1.MaxItems(maxItems);
}
exports.MaxItems = MaxItems;
//# sourceMappingURL=maxItems.js.map