@tsed/common
Version:
A TypeScript Framework on top of Express
53 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MaxProperties = void 0;
const schema_1 = require("@tsed/schema");
/**
* An object instance is valid against `maxProperties` if its number of properties is less than, or equal to, the value of this keyword.
*
* ::: warning
* The value of this keyword MUST be a non-negative integer.
* :::
*
* ::: warning
* This decorator will be removed in v7.
* For v6 user, use @@MaxProperties@@ from @tsed/schema instead of @tsed/common.
* :::
*
* ## Example
* ### On prop
* ```typescript
* class Model {
* @Any()
* @MaxProperties(10)
* property: any;
* }
* ```
*
* Will produce:
*
* ```json
* {
* "type": "object",
* "properties": {
* "property": {
* "type": "any",
* "maxProperties": 10
* }
* }
* }
* ```
*
* @param {number} maxProperties
* @validation
* @swagger
* @schema
* @collections
* @ignore
* @deprecated Since v6. Use @MaxProperties decorator from @tsed/schema instead of.
*/
function MaxProperties(maxProperties) {
return schema_1.MaxProperties(maxProperties);
}
exports.MaxProperties = MaxProperties;
//# sourceMappingURL=maxProperties.js.map