File tree 1 file changed +5
-0
lines changed
packages/zod-nestjs/src/lib
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ export type ZodDtoStatic<T extends CompatibleZodType = CompatibleZodType> = {
61
61
// Used for transforming the SchemaObject in _OPENAPI_METADATA_FACTORY
62
62
type SchemaObjectForMetadataFactory = Omit < SchemaObject30 , 'required' > & {
63
63
required : boolean | string [ ] ;
64
+ isArray ?: boolean ;
64
65
} ;
65
66
66
67
export const createZodDto = < T extends OpenApiZodAny > (
@@ -148,6 +149,10 @@ export const createZodDto = <T extends OpenApiZodAny>(
148
149
convertedSchemaObject . type = 'string' ; // There ist no explicit null value in OpenAPI 3.0
149
150
convertedSchemaObject . nullable = true ;
150
151
}
152
+ // Array handling (NestJS references 'isArray' boolean)
153
+ if ( convertedSchemaObject . type === 'array' ) {
154
+ convertedSchemaObject . isArray = true ;
155
+ }
151
156
// Exclusive minimum and maximum
152
157
const { exclusiveMinimum, exclusiveMaximum } = schemaObject ;
153
158
if ( exclusiveMinimum !== undefined ) {
You can’t perform that action at this time.
0 commit comments