@tsed/common
Version:
A TypeScript Framework on top of Express
71 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Integer = void 0;
const schema_1 = require("@tsed/schema");
/**
* Set integer type.
*
* ::: warning
* This decorator will be removed in v7.
* For v6 user, use @@Integer@@ from @tsed/schema instead of @@Integer@@ from @tsed/common.
* :::
*
* ## Example
*
* ```typescript
* class Model {
* @Integer()
* property: number;
* }
* ```
*
* Will produce:
*
* ```json
* {
* "type": "object",
* "properties": {
* "property": {
* "type": "integer"
* }
* }
* }
* ```
*
* ### With array of multiple types
*
* ```typescript
* class Model {
* @Integer()
* property: number[];
* }
* ```
*
* Will produce:
*
* ```json
* {
* "type": "object",
* "properties": {
* "property": {
* "type": "array",
* "items": {
* "type": "integer"
* }
* }
* }
* }
* ```
*
* @decorator
* @validation
* @swagger
* @schema
* @ignore
* @deprecated Since v6. Use @Integer decorator from @tsed/schema instead of.
*/
function Integer() {
return schema_1.Integer();
}
exports.Integer = Integer;
//# sourceMappingURL=integer.js.map