Skip to content

Commit

Permalink
fix: Improve array handling not fully functional (misses item type) #215
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsharvey committed Aug 4, 2024
1 parent 9d03494 commit 2d80cfd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/zod-nestjs/src/lib/create-zod-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ export const createZodDto = <T extends OpenApiZodAny>(
convertedSchemaObject.type = 'string'; // There ist no explicit null value in OpenAPI 3.0
convertedSchemaObject.nullable = true;
}
// Array handling (NestJS references 'isArray' boolean)
if (convertedSchemaObject.type === 'array') {
convertedSchemaObject.isArray = true;
}
// Exclusive minimum and maximum
const { exclusiveMinimum, exclusiveMaximum } = schemaObject;
if (exclusiveMinimum !== undefined) {
Expand Down

0 comments on commit 2d80cfd

Please sign in to comment.