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