Skip to content

Commit

Permalink
Some other last fixes I just realized
Browse files Browse the repository at this point in the history
  • Loading branch information
A5rocks committed Nov 23, 2023
1 parent f1e887a commit e360646
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/zod-nestjs/src/lib/create-zod-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export const createZodDto = <T extends OpenApiZodAny>(
const schemaObject = properties[key] as SchemaObjectForMetadataFactory;
const schemaObjectWithFixedFields = {
...schemaObject,
type: schemaObject.type ? schemaObject.type[0] : schemaObject.type
type: schemaObject.type ? schemaObject.type[0] : schemaObject.type,
nullable: schemaObject.type ? schemaObject.type.includes('null') : false,
exclusiveMinimum: schemaObject.exclusiveMinimum ? true : schemaObject.exclusiveMinimum,
exclusiveMaximum: schemaObject.exclusiveMaximum ? true : schemaObject.exclusiveMaximum,
};
schemaObjectWithFixedFields.required = !!(generatedSchema.required !== undefined,
generatedSchema.required?.includes(key));
Expand Down

0 comments on commit e360646

Please sign in to comment.