@nestjs/swagger
Advanced tools
Comparing version 7.4.1 to 7.4.2
@@ -17,2 +17,3 @@ "use strict"; | ||
required: options.required, | ||
examples: options.examples, | ||
schema: Object.assign({ type: 'string' }, (options.schema || {})) | ||
@@ -19,0 +20,0 @@ }, (0, lodash_1.negate)(lodash_1.isUndefined)); |
@@ -6,2 +6,3 @@ import { SchemaObjectMetadata } from '../interfaces/schema-object-metadata.interface'; | ||
enumName?: string; | ||
'x-enumNames'?: string[]; | ||
} | ||
@@ -8,0 +9,0 @@ export declare function ApiProperty(options?: ApiPropertyOptions): PropertyDecorator; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="lodash" /> | ||
import { Type } from '@nestjs/common'; | ||
@@ -17,3 +16,3 @@ import { BaseParameterObject, ParameterObject, ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface'; | ||
mergePropertyWithMetadata(key: string, prototype: Type<unknown>, schemas: Record<string, SchemaObject>, pendingSchemaRefs: string[], metadata?: SchemaObjectMetadata): SchemaObjectMetadata | ReferenceObject | ParameterObject; | ||
createEnumParam(param: ParamWithTypeMetadata & BaseParameterObject, schemas: Record<string, SchemaObject>): import("lodash").Omit<ParamWithTypeMetadata & BaseParameterObject, "items" | "enum" | "isArray" | "enumName">; | ||
createEnumParam(param: ParamWithTypeMetadata & BaseParameterObject, schemas: Record<string, SchemaObject>): Partial<ParamWithTypeMetadata & BaseParameterObject>; | ||
createEnumSchemaType(key: string, metadata: SchemaObjectMetadata, schemas: Record<string, SchemaObject>): Partial<{ | ||
@@ -20,0 +19,0 @@ $ref: string; |
@@ -65,4 +65,4 @@ "use strict"; | ||
return propertiesWithType.map((property) => { | ||
var _a; | ||
const parameterObject = Object.assign(Object.assign({}, (0, lodash_1.omit)(property, 'enumName')), { in: 'query', required: (_a = property.required) !== null && _a !== void 0 ? _a : true }); | ||
var _a, _b; | ||
const parameterObject = Object.assign(Object.assign({}, (0, lodash_1.omit)(property, 'enumName')), { in: (_a = param.in) !== null && _a !== void 0 ? _a : 'query', required: (_b = property.required) !== null && _b !== void 0 ? _b : true }); | ||
return parameterObject; | ||
@@ -154,8 +154,5 @@ }); | ||
: undefined; | ||
schemas[enumName] = { | ||
type: (_d = (param.isArray | ||
schemas[enumName] = Object.assign({ type: (_d = (param.isArray | ||
? (_b = (_a = param.schema) === null || _a === void 0 ? void 0 : _a['items']) === null || _b === void 0 ? void 0 : _b['type'] | ||
: (_c = param.schema) === null || _c === void 0 ? void 0 : _c['type'])) !== null && _d !== void 0 ? _d : 'string', | ||
enum: _enum | ||
}; | ||
: (_c = param.schema) === null || _c === void 0 ? void 0 : _c['type'])) !== null && _d !== void 0 ? _d : 'string', enum: _enum }, (param['x-enumNames'] ? { 'x-enumNames': param['x-enumNames'] } : {})); | ||
} | ||
@@ -166,3 +163,3 @@ param.schema = | ||
: { $ref }; | ||
return (0, lodash_1.omit)(param, ['isArray', 'items', 'enumName', 'enum']); | ||
return (0, lodash_1.omit)(param, ['isArray', 'items', 'enumName', 'enum', 'x-enumNames']); | ||
} | ||
@@ -169,0 +166,0 @@ createEnumSchemaType(key, metadata, schemas) { |
@@ -84,3 +84,4 @@ "use strict"; | ||
'nullable', | ||
'default' | ||
'default', | ||
'example' | ||
]; | ||
@@ -87,0 +88,0 @@ } |
{ | ||
"name": "@nestjs/swagger", | ||
"version": "7.4.1", | ||
"version": "7.4.2", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@swagger)", | ||
@@ -38,6 +38,6 @@ "author": "Kamil Mysliwiec", | ||
"@fastify/static": "7.0.4", | ||
"@nestjs/common": "10.4.1", | ||
"@nestjs/core": "10.4.1", | ||
"@nestjs/platform-express": "10.4.1", | ||
"@nestjs/platform-fastify": "10.4.1", | ||
"@nestjs/common": "10.4.2", | ||
"@nestjs/core": "10.4.2", | ||
"@nestjs/platform-express": "10.4.2", | ||
"@nestjs/platform-fastify": "10.4.2", | ||
"@types/jest": "29.5.13", | ||
@@ -47,10 +47,10 @@ "@types/js-yaml": "4.0.9", | ||
"@types/node": "20.16.5", | ||
"@typescript-eslint/eslint-plugin": "8.5.0", | ||
"@typescript-eslint/parser": "8.5.0", | ||
"@typescript-eslint/eslint-plugin": "8.6.0", | ||
"@typescript-eslint/parser": "8.6.0", | ||
"class-transformer": "0.5.1", | ||
"class-validator": "0.14.1", | ||
"eslint": "8.57.0", | ||
"eslint": "8.57.1", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-import": "2.30.0", | ||
"express": "4.20.0", | ||
"express": "4.21.0", | ||
"husky": "9.1.6", | ||
@@ -57,0 +57,0 @@ "jest": "29.7.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
315264
6291