nestjs-openapi 0.3.0 → 0.3.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/dist/cli.mjs +1 -1
- package/dist/index.d.mts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.mjs +2 -2
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.mjs +1 -1
- package/dist/shared/{nestjs-openapi.CAanamW0.d.mts → nestjs-openapi.CDtSgIYg.d.mts} +204 -204
- package/dist/shared/{nestjs-openapi.CAanamW0.d.ts → nestjs-openapi.CDtSgIYg.d.ts} +204 -204
- package/dist/shared/{nestjs-openapi.Nd-wGr8A.mjs → nestjs-openapi.CU_zMKfF.mjs} +5 -5
- package/package.json +1 -1
|
@@ -1057,12 +1057,12 @@ const decoratorHandlers = {
|
|
|
1057
1057
|
})
|
|
1058
1058
|
),
|
|
1059
1059
|
ApiProperty: apiPropertyDecoratorHandler,
|
|
1060
|
-
ApiPropertyOptional: apiPropertyDecoratorHandler
|
|
1060
|
+
ApiPropertyOptional: (state, decorator) => apiPropertyDecoratorHandler({ ...state, isOptional: true }, decorator)
|
|
1061
1061
|
};
|
|
1062
|
-
const
|
|
1063
|
-
isOptional:
|
|
1062
|
+
const createInitialPropertyValidationInfo = (property) => ({
|
|
1063
|
+
isOptional: property.hasQuestionToken(),
|
|
1064
1064
|
constraints: {}
|
|
1065
|
-
};
|
|
1065
|
+
});
|
|
1066
1066
|
const applyDecorator = (state, decorator) => getDecoratorName(decorator).pipe(
|
|
1067
1067
|
Option.flatMap((name) => Option.fromNullable(decoratorHandlers[name])),
|
|
1068
1068
|
Option.match({
|
|
@@ -1072,7 +1072,7 @@ const applyDecorator = (state, decorator) => getDecoratorName(decorator).pipe(
|
|
|
1072
1072
|
);
|
|
1073
1073
|
const extractPropertyState = (property) => property.getDecorators().reduce(
|
|
1074
1074
|
applyDecorator,
|
|
1075
|
-
|
|
1075
|
+
createInitialPropertyValidationInfo(property)
|
|
1076
1076
|
);
|
|
1077
1077
|
const hasConstraints = (constraints) => Object.keys(constraints).length > 0;
|
|
1078
1078
|
const extractPropertyConstraints = (property) => extractPropertyState(property).constraints;
|
package/package.json
CHANGED