@tsed/schema 7.79.4 → 7.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/schema.umd.min.js.map +1 -1
- package/lib/cjs/components/default/inlineEnumsMapper.js +2 -2
- package/lib/cjs/components/default/inlineEnumsMapper.js.map +1 -1
- package/lib/cjs/components/default/nullableMapper.js +4 -4
- package/lib/cjs/components/default/nullableMapper.js.map +1 -1
- package/lib/cjs/components/default/requiredMapper.js +4 -4
- package/lib/cjs/components/default/requiredMapper.js.map +1 -1
- package/lib/cjs/components/open-spec/nullableMapper.js +4 -4
- package/lib/cjs/components/open-spec/nullableMapper.js.map +1 -1
- package/lib/cjs/utils/generateSpec.js +1 -24
- package/lib/cjs/utils/generateSpec.js.map +1 -1
- package/lib/esm/components/default/inlineEnumsMapper.js.map +1 -1
- package/lib/esm/components/default/nullableMapper.js.map +1 -1
- package/lib/esm/components/default/requiredMapper.js.map +1 -1
- package/lib/esm/components/open-spec/nullableMapper.js.map +1 -1
- package/lib/esm/utils/getJsonSchema.js +1 -1
- package/lib/types/components/default/inlineEnumsMapper.d.ts +2 -2
- package/lib/types/components/default/nullableMapper.d.ts +1 -1
- package/lib/types/components/default/requiredMapper.d.ts +2 -2
- package/lib/types/components/open-spec/nullableMapper.d.ts +1 -1
- package/lib/types-esm/components/async-api/channelsMapper.d.ts +2 -0
- package/lib/types-esm/components/async-api/generate.d.ts +1 -0
- package/lib/types-esm/components/async-api/messageMapper.d.ts +6 -0
- package/lib/types-esm/components/async-api/payloadMapper.d.ts +4 -0
- package/lib/types-esm/components/async-api/responseMapper.d.ts +6 -0
- package/lib/types-esm/components/default/anyMapper.d.ts +2 -0
- package/lib/types-esm/components/default/classMapper.d.ts +3 -0
- package/lib/types-esm/components/default/genericsMapper.d.ts +5 -0
- package/lib/types-esm/components/default/inheritedClassMapper.d.ts +5 -0
- package/lib/types-esm/components/default/inlineEnumsMapper.d.ts +3 -0
- package/lib/types-esm/components/default/itemMapper.d.ts +2 -0
- package/lib/types-esm/components/default/lazyRefMapper.d.ts +3 -0
- package/lib/types-esm/components/default/mapMapper.d.ts +9 -0
- package/lib/types-esm/components/default/nullableMapper.d.ts +2 -0
- package/lib/types-esm/components/default/objectMapper.d.ts +8 -0
- package/lib/types-esm/components/default/ofMapper.d.ts +3 -0
- package/lib/types-esm/components/default/propertiesMapper.d.ts +3 -0
- package/lib/types-esm/components/default/requiredMapper.d.ts +3 -0
- package/lib/types-esm/components/default/schemaMapper.d.ts +3 -0
- package/lib/types-esm/components/index.d.ts +33 -0
- package/lib/types-esm/components/open-spec/generate.d.ts +1 -0
- package/lib/types-esm/components/open-spec/nullableMapper.d.ts +2 -0
- package/lib/types-esm/components/open-spec/operationInFilesMapper.d.ts +2 -0
- package/lib/types-esm/components/open-spec/operationInParameterMapper.d.ts +10 -0
- package/lib/types-esm/components/open-spec/operationInParametersMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationInQueryMapper.d.ts +2 -0
- package/lib/types-esm/components/open-spec/operationMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationMediaMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationRequestBodyMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/operationResponseMapper.d.ts +3 -0
- package/lib/types-esm/components/open-spec/pathsMapper.d.ts +2 -0
- package/lib/types-esm/constants/OperationVerbs.d.ts +20 -0
- package/lib/types-esm/constants/httpStatusMessages.d.ts +11 -0
- package/lib/types-esm/constants/jsonSchemaProperties.d.ts +7 -0
- package/lib/types-esm/decorators/class/children.d.ts +11 -0
- package/lib/types-esm/decorators/class/discriminatorValue.d.ts +42 -0
- package/lib/types-esm/decorators/collections/collectionContains.d.ts +21 -0
- package/lib/types-esm/decorators/collections/collectionOf.d.ts +101 -0
- package/lib/types-esm/decorators/collections/maxItems.d.ts +48 -0
- package/lib/types-esm/decorators/collections/maxProperties.d.ts +71 -0
- package/lib/types-esm/decorators/collections/minItems.d.ts +52 -0
- package/lib/types-esm/decorators/collections/minProperties.d.ts +70 -0
- package/lib/types-esm/decorators/collections/uniqueItems.d.ts +51 -0
- package/lib/types-esm/decorators/common/additionalProperties.d.ts +11 -0
- package/lib/types-esm/decorators/common/allOf.d.ts +13 -0
- package/lib/types-esm/decorators/common/allow.d.ts +28 -0
- package/lib/types-esm/decorators/common/any.d.ts +38 -0
- package/lib/types-esm/decorators/common/anyOf.d.ts +17 -0
- package/lib/types-esm/decorators/common/const.d.ts +61 -0
- package/lib/types-esm/decorators/common/customKey.d.ts +26 -0
- package/lib/types-esm/decorators/common/default.d.ts +41 -0
- package/lib/types-esm/decorators/common/defaultMsg.d.ts +32 -0
- package/lib/types-esm/decorators/common/description.d.ts +53 -0
- package/lib/types-esm/decorators/common/discriminatorKey.d.ts +1 -0
- package/lib/types-esm/decorators/common/enum.d.ts +101 -0
- package/lib/types-esm/decorators/common/errorMsg.d.ts +6 -0
- package/lib/types-esm/decorators/common/example.d.ts +11 -0
- package/lib/types-esm/decorators/common/examples.d.ts +12 -0
- package/lib/types-esm/decorators/common/exclusiveMaximum.d.ts +70 -0
- package/lib/types-esm/decorators/common/exclusiveMinimum.d.ts +70 -0
- package/lib/types-esm/decorators/common/format.d.ts +466 -0
- package/lib/types-esm/decorators/common/forwardGroups.d.ts +10 -0
- package/lib/types-esm/decorators/common/groups.d.ts +12 -0
- package/lib/types-esm/decorators/common/hidden.d.ts +32 -0
- package/lib/types-esm/decorators/common/ignore.d.ts +59 -0
- package/lib/types-esm/decorators/common/integer.d.ts +61 -0
- package/lib/types-esm/decorators/common/jsonEntityFn.d.ts +21 -0
- package/lib/types-esm/decorators/common/maxLength.d.ts +77 -0
- package/lib/types-esm/decorators/common/maximum.d.ts +139 -0
- package/lib/types-esm/decorators/common/minLength.d.ts +78 -0
- package/lib/types-esm/decorators/common/minimum.d.ts +137 -0
- package/lib/types-esm/decorators/common/multipleOf.d.ts +69 -0
- package/lib/types-esm/decorators/common/name.d.ts +32 -0
- package/lib/types-esm/decorators/common/nullable.d.ts +25 -0
- package/lib/types-esm/decorators/common/oneOf.d.ts +17 -0
- package/lib/types-esm/decorators/common/optional.d.ts +10 -0
- package/lib/types-esm/decorators/common/pattern.d.ts +94 -0
- package/lib/types-esm/decorators/common/property.d.ts +11 -0
- package/lib/types-esm/decorators/common/readOnly.d.ts +11 -0
- package/lib/types-esm/decorators/common/recordOf.d.ts +46 -0
- package/lib/types-esm/decorators/common/required.d.ts +44 -0
- package/lib/types-esm/decorators/common/requiredGroups.d.ts +10 -0
- package/lib/types-esm/decorators/common/schema.d.ts +53 -0
- package/lib/types-esm/decorators/common/title.d.ts +39 -0
- package/lib/types-esm/decorators/common/typeError.d.ts +8 -0
- package/lib/types-esm/decorators/common/writeOnly.d.ts +11 -0
- package/lib/types-esm/decorators/config/jsonEntityComponent.d.ts +10 -0
- package/lib/types-esm/decorators/generics/genericOf.d.ts +76 -0
- package/lib/types-esm/decorators/generics/generics.d.ts +14 -0
- package/lib/types-esm/decorators/operations/acceptMime.d.ts +19 -0
- package/lib/types-esm/decorators/operations/consumes.d.ts +19 -0
- package/lib/types-esm/decorators/operations/contentType.d.ts +20 -0
- package/lib/types-esm/decorators/operations/deprecated.d.ts +23 -0
- package/lib/types-esm/decorators/operations/header.d.ts +49 -0
- package/lib/types-esm/decorators/operations/in.d.ts +64 -0
- package/lib/types-esm/decorators/operations/inFile.d.ts +25 -0
- package/lib/types-esm/decorators/operations/location.d.ts +22 -0
- package/lib/types-esm/decorators/operations/operation.d.ts +60 -0
- package/lib/types-esm/decorators/operations/operationId.d.ts +10 -0
- package/lib/types-esm/decorators/operations/operationPath.d.ts +21 -0
- package/lib/types-esm/decorators/operations/partial.d.ts +10 -0
- package/lib/types-esm/decorators/operations/path.d.ts +15 -0
- package/lib/types-esm/decorators/operations/produces.d.ts +26 -0
- package/lib/types-esm/decorators/operations/publish.d.ts +1 -0
- package/lib/types-esm/decorators/operations/redirect.d.ts +52 -0
- package/lib/types-esm/decorators/operations/returns.d.ts +267 -0
- package/lib/types-esm/decorators/operations/route.d.ts +133 -0
- package/lib/types-esm/decorators/operations/security.d.ts +23 -0
- package/lib/types-esm/decorators/operations/status.d.ts +127 -0
- package/lib/types-esm/decorators/operations/subscribe.d.ts +1 -0
- package/lib/types-esm/decorators/operations/summary.d.ts +20 -0
- package/lib/types-esm/decorators/operations/tags.d.ts +23 -0
- package/lib/types-esm/decorators/operations/view.d.ts +23 -0
- package/lib/types-esm/domain/DecoratorContext.d.ts +28 -0
- package/lib/types-esm/domain/JsonAliasMap.d.ts +12 -0
- package/lib/types-esm/domain/JsonClassStore.d.ts +12 -0
- package/lib/types-esm/domain/JsonDiscriminator.d.ts +18 -0
- package/lib/types-esm/domain/JsonEntityStore.d.ts +110 -0
- package/lib/types-esm/domain/JsonFormatTypes.d.ts +17 -0
- package/lib/types-esm/domain/JsonLazyRef.d.ts +9 -0
- package/lib/types-esm/domain/JsonMap.d.ts +9 -0
- package/lib/types-esm/domain/JsonMedia.d.ts +11 -0
- package/lib/types-esm/domain/JsonMethodStore.d.ts +92 -0
- package/lib/types-esm/domain/JsonOperation.d.ts +51 -0
- package/lib/types-esm/domain/JsonOperationPathsMap.d.ts +7 -0
- package/lib/types-esm/domain/JsonOperationRoute.d.ts +25 -0
- package/lib/types-esm/domain/JsonParameter.d.ts +22 -0
- package/lib/types-esm/domain/JsonParameterStore.d.ts +52 -0
- package/lib/types-esm/domain/JsonParameterTypes.d.ts +16 -0
- package/lib/types-esm/domain/JsonPropertyStore.d.ts +32 -0
- package/lib/types-esm/domain/JsonRequestBody.d.ts +12 -0
- package/lib/types-esm/domain/JsonResponse.d.ts +18 -0
- package/lib/types-esm/domain/JsonSchema.d.ts +340 -0
- package/lib/types-esm/domain/SpecTypes.d.ts +6 -0
- package/lib/types-esm/hooks/alterIgnore.d.ts +10 -0
- package/lib/types-esm/hooks/alterOneOf.d.ts +3 -0
- package/lib/types-esm/hooks/alterRequiredGroups.d.ts +6 -0
- package/lib/types-esm/index.d.ts +182 -0
- package/lib/types-esm/interfaces/IgnoreCallback.d.ts +4 -0
- package/lib/types-esm/interfaces/JsonHookContext.d.ts +17 -0
- package/lib/types-esm/interfaces/JsonOpenSpec.d.ts +9 -0
- package/lib/types-esm/interfaces/JsonSchemaOptions.d.ts +30 -0
- package/lib/types-esm/registries/JsonSchemaMapperContainer.d.ts +21 -0
- package/lib/types-esm/registries/enumRegistries.d.ts +2 -0
- package/lib/types-esm/utils/buildPath.d.ts +6 -0
- package/lib/types-esm/utils/concatParameters.d.ts +4 -0
- package/lib/types-esm/utils/concatPath.d.ts +1 -0
- package/lib/types-esm/utils/defineStatusModel.d.ts +3 -0
- package/lib/types-esm/utils/from.d.ts +190 -0
- package/lib/types-esm/utils/generateSpec.d.ts +16 -0
- package/lib/types-esm/utils/generics.d.ts +50 -0
- package/lib/types-esm/utils/getComputedType.d.ts +5 -0
- package/lib/types-esm/utils/getInheritedStores.d.ts +8 -0
- package/lib/types-esm/utils/getJsonEntityStore.d.ts +15 -0
- package/lib/types-esm/utils/getJsonPathParameters.d.ts +7 -0
- package/lib/types-esm/utils/getJsonSchema.d.ts +4 -0
- package/lib/types-esm/utils/getJsonType.d.ts +5 -0
- package/lib/types-esm/utils/getOperationsRoutes.d.ts +10 -0
- package/lib/types-esm/utils/getOperationsStores.d.ts +6 -0
- package/lib/types-esm/utils/getPropertiesStores.d.ts +20 -0
- package/lib/types-esm/utils/getSpec.d.ts +34 -0
- package/lib/types-esm/utils/getSpecType.d.ts +12 -0
- package/lib/types-esm/utils/isSuccessStatus.d.ts +2 -0
- package/lib/types-esm/utils/mapHeaders.d.ts +9 -0
- package/lib/types-esm/utils/mapOpenSpec.d.ts +10 -0
- package/lib/types-esm/utils/mapOpenSpec2.d.ts +9 -0
- package/lib/types-esm/utils/mapOpenSpec3.d.ts +8 -0
- package/lib/types-esm/utils/mapOpenSpecInfo.d.ts +6 -0
- package/lib/types-esm/utils/mapOperationOptions.d.ts +5 -0
- package/lib/types-esm/utils/matchGroups.d.ts +4 -0
- package/lib/types-esm/utils/mergeSpec.d.ts +23 -0
- package/lib/types-esm/utils/operationIdFormatter.d.ts +6 -0
- package/lib/types-esm/utils/ref.d.ts +14 -0
- package/lib/types-esm/utils/removeHiddenOperation.d.ts +2 -0
- package/lib/types-esm/utils/serializeEnumValues.d.ts +5 -0
- package/lib/types-esm/utils/somethingOf.d.ts +1 -0
- package/lib/types-esm/utils/toJsonMapCollection.d.ts +7 -0
- package/lib/types-esm/utils/toJsonRegex.d.ts +5 -0
- package/lib/types-esm/utils/transformToOS2.d.ts +25 -0
- package/lib/types-esm/utils/withErrorMsg.d.ts +6 -0
- package/package.json +21 -17
- package/vitest.config.mts +21 -0
- package/jest.config.js +0 -21
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
- package/tsconfig.esm.json +0 -36
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add a description to the class, method or property
|
|
3
|
+
*
|
|
4
|
+
* ## Examples
|
|
5
|
+
* ### On class
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* @Description("description")
|
|
9
|
+
* class Model {
|
|
10
|
+
*
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* ### On method
|
|
15
|
+
*
|
|
16
|
+
* ```typescript
|
|
17
|
+
* @Controller("/")
|
|
18
|
+
* class ModelCtrl {
|
|
19
|
+
* @Description("description")
|
|
20
|
+
* async method() {}
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* ### On parameter
|
|
25
|
+
*
|
|
26
|
+
* ```typescript
|
|
27
|
+
* @Controller("/")
|
|
28
|
+
* class ModelCtrl {
|
|
29
|
+
* async method(@Description("description") @PathParam("id") id: string) {}
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* ### On property
|
|
34
|
+
*
|
|
35
|
+
* ```typescript
|
|
36
|
+
* class Model {
|
|
37
|
+
* @Description("description")
|
|
38
|
+
* id: string;
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param {string} description
|
|
43
|
+
* @decorator
|
|
44
|
+
* @validation
|
|
45
|
+
* @swagger
|
|
46
|
+
* @schema
|
|
47
|
+
* @input
|
|
48
|
+
* @classDecorator
|
|
49
|
+
* @methodDecorator
|
|
50
|
+
* @propertyDecorator
|
|
51
|
+
* @parameterDecorator
|
|
52
|
+
*/
|
|
53
|
+
export declare function Description(description: any): (...args: any[]) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DiscriminatorKey(): PropertyDecorator;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { JSONSchema6Type } from "json-schema";
|
|
2
|
+
declare function EnumFn(...enumValues: (JSONSchema6Type | any)[]): Function;
|
|
3
|
+
/**
|
|
4
|
+
* The enum keyword is used to restrict a value to a fixed set of values.
|
|
5
|
+
* It must be an array with at least one element, where each element is unique.
|
|
6
|
+
*
|
|
7
|
+
* Elements in the array might be of any value, including null.
|
|
8
|
+
*
|
|
9
|
+
* ::: warning
|
|
10
|
+
* For v6 user, use @@Enum@@ from @tsed/schema instead of @tsed/common.
|
|
11
|
+
* :::
|
|
12
|
+
*
|
|
13
|
+
* ## Example
|
|
14
|
+
* ### With primitive type
|
|
15
|
+
*
|
|
16
|
+
* ```typescript
|
|
17
|
+
* class Model {
|
|
18
|
+
* @Enum("value1", "value2")
|
|
19
|
+
* property: "value1" | "value2";
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Will produce:
|
|
24
|
+
*
|
|
25
|
+
* ```json
|
|
26
|
+
* {
|
|
27
|
+
* "type": "object",
|
|
28
|
+
* "properties": {
|
|
29
|
+
* "property": {
|
|
30
|
+
* "type": "string",
|
|
31
|
+
* "enum": ["value1", "value2"]
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ### With array type
|
|
38
|
+
*
|
|
39
|
+
* ```typescript
|
|
40
|
+
* class Model {
|
|
41
|
+
* @Enum("value1", "value2")
|
|
42
|
+
* property: ("value1" | "value2")[];
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* Will produce:
|
|
47
|
+
*
|
|
48
|
+
* ```json
|
|
49
|
+
* {
|
|
50
|
+
* "type": "object",
|
|
51
|
+
* "properties": {
|
|
52
|
+
* "property": {
|
|
53
|
+
* "type": "array",
|
|
54
|
+
* "items": {
|
|
55
|
+
* "type": "string",
|
|
56
|
+
* "enum": ["value1", "value2"]
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* ### With Typescript Enum
|
|
64
|
+
*
|
|
65
|
+
* ```typescript
|
|
66
|
+
* enum SomeEnum {
|
|
67
|
+
* ENUM_1 = "enum1",
|
|
68
|
+
* ENUM_2 = "enum2"
|
|
69
|
+
* }
|
|
70
|
+
*
|
|
71
|
+
* class Model {
|
|
72
|
+
* @Enum(SomeEnum)
|
|
73
|
+
* property: SomeEnum;
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* Will produce:
|
|
78
|
+
*
|
|
79
|
+
* ```json
|
|
80
|
+
* {
|
|
81
|
+
* "type": "object",
|
|
82
|
+
* "properties": {
|
|
83
|
+
* "property": {
|
|
84
|
+
* "type": "string",
|
|
85
|
+
* "enum": ["enum1", "enum2"]
|
|
86
|
+
* }
|
|
87
|
+
* }
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @param {string | number | boolean | {}} enumValue
|
|
92
|
+
* @param enumValues
|
|
93
|
+
* @decorator
|
|
94
|
+
* @validation
|
|
95
|
+
* @swagger
|
|
96
|
+
* @schema
|
|
97
|
+
* @input
|
|
98
|
+
* @ajv-errors
|
|
99
|
+
*/
|
|
100
|
+
export declare const Enum: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<typeof EnumFn>;
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OpenSpecHash, OpenSpecRef, OS3Example } from "@tsed/openspec";
|
|
2
|
+
/**
|
|
3
|
+
* Add a examples metadata on the decorated element.
|
|
4
|
+
*
|
|
5
|
+
* @decorator
|
|
6
|
+
* @swagger
|
|
7
|
+
* @schema
|
|
8
|
+
* @input
|
|
9
|
+
* @methodDecorator
|
|
10
|
+
* @classDecorator
|
|
11
|
+
*/
|
|
12
|
+
export declare function Examples(examples: OpenSpecHash<OS3Example | OpenSpecRef>): ParameterDecorator;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value of `exclusiveMaximum` MUST be number, representing an exclusive upper limit for a numeric instance.
|
|
3
|
+
*
|
|
4
|
+
* If the instance is a number, then the instance is valid only if it has a value strictly less than (not equal to) `exclusiveMaximum`.
|
|
5
|
+
*
|
|
6
|
+
* ::: warning
|
|
7
|
+
* For v6 user, use @@ExclusiveMaximum@@ from @tsed/schema instead of @tsed/common.
|
|
8
|
+
* :::
|
|
9
|
+
*
|
|
10
|
+
* ## Example
|
|
11
|
+
* ### With primitive type
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* class Model {
|
|
15
|
+
* @ExclusiveMaximum(10)
|
|
16
|
+
* property: number;
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Will produce:
|
|
21
|
+
*
|
|
22
|
+
* ```json
|
|
23
|
+
* {
|
|
24
|
+
* "type": "object",
|
|
25
|
+
* "properties": {
|
|
26
|
+
* "property": {
|
|
27
|
+
* "type": "number",
|
|
28
|
+
* "exclusiveMaximum": 10
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* ### With array type
|
|
35
|
+
*
|
|
36
|
+
* ```typescript
|
|
37
|
+
* class Model {
|
|
38
|
+
* @ExclusiveMaximum(10)
|
|
39
|
+
* @CollectionOf(Number)
|
|
40
|
+
* property: number[];
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Will produce:
|
|
45
|
+
*
|
|
46
|
+
* ```json
|
|
47
|
+
* {
|
|
48
|
+
* "type": "object",
|
|
49
|
+
* "properties": {
|
|
50
|
+
* "property": {
|
|
51
|
+
* "type": "array",
|
|
52
|
+
* "items": {
|
|
53
|
+
* "type": "number",
|
|
54
|
+
* "exclusiveMaximum": 10
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @param maximum
|
|
62
|
+
* @param {boolean} exclusiveMaximum
|
|
63
|
+
* @decorator
|
|
64
|
+
* @validation
|
|
65
|
+
* @swagger
|
|
66
|
+
* @schema
|
|
67
|
+
* @input
|
|
68
|
+
* @ajv-errors
|
|
69
|
+
*/
|
|
70
|
+
export declare const ExclusiveMaximum: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(maximum: number, exclusiveMaximum?: boolean) => import("../../utils/withErrorMsg.js").ErrorChainedMethods<(maximum: number, exclusive?: boolean) => (...args: any[]) => any>>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value of `exclusiveMinimum` MUST be number, representing an exclusive upper limit for a numeric instance.
|
|
3
|
+
*
|
|
4
|
+
* If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) `exclusiveMinimum`.
|
|
5
|
+
*
|
|
6
|
+
* ::: warning
|
|
7
|
+
* For v6 user, use @@ExclusiveMinimum@@ from @tsed/schema instead of @tsed/common.
|
|
8
|
+
* :::
|
|
9
|
+
*
|
|
10
|
+
* ## Example
|
|
11
|
+
* ### With primitive type
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* class Model {
|
|
15
|
+
* @ExclusiveMinimum(10)
|
|
16
|
+
* property: number;
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Will produce:
|
|
21
|
+
*
|
|
22
|
+
* ```json
|
|
23
|
+
* {
|
|
24
|
+
* "type": "object",
|
|
25
|
+
* "properties": {
|
|
26
|
+
* "property": {
|
|
27
|
+
* "type": "number",
|
|
28
|
+
* "exclusiveMinimum": 10
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* ### With array type
|
|
35
|
+
*
|
|
36
|
+
* ```typescript
|
|
37
|
+
* class Model {
|
|
38
|
+
* @ExclusiveMinimum(10)
|
|
39
|
+
* @CollectionOf(Number)
|
|
40
|
+
* property: number[];
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Will produce:
|
|
45
|
+
*
|
|
46
|
+
* ```json
|
|
47
|
+
* {
|
|
48
|
+
* "type": "object",
|
|
49
|
+
* "properties": {
|
|
50
|
+
* "property": {
|
|
51
|
+
* "type": "array",
|
|
52
|
+
* "items": {
|
|
53
|
+
* "type": "number",
|
|
54
|
+
* "exclusiveMinimum": 10
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @param minimum
|
|
62
|
+
* @param {boolean} exclusiveMinimum
|
|
63
|
+
* @decorator
|
|
64
|
+
* @validation
|
|
65
|
+
* @swagger
|
|
66
|
+
* @schema
|
|
67
|
+
* @input
|
|
68
|
+
* @ajv-errors
|
|
69
|
+
*/
|
|
70
|
+
export declare const ExclusiveMinimum: import("../../utils/withErrorMsg.js").ErrorChainedDecorator<(minimum: number, exclusiveMinimum?: boolean) => import("../../utils/withErrorMsg.js").ErrorChainedMethods<(minimum: number, exclusive?: boolean) => (...args: any[]) => any>>;
|