Skip to content

Commit 2d80cfd

Browse files
committed
fix: Improve array handling not fully functional (misses item type) #215
1 parent 9d03494 commit 2d80cfd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/zod-nestjs/src/lib/create-zod-dto.ts

+4
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ export const createZodDto = <T extends OpenApiZodAny>(
148148
convertedSchemaObject.type = 'string'; // There ist no explicit null value in OpenAPI 3.0
149149
convertedSchemaObject.nullable = true;
150150
}
151+
// Array handling (NestJS references 'isArray' boolean)
152+
if (convertedSchemaObject.type === 'array') {
153+
convertedSchemaObject.isArray = true;
154+
}
151155
// Exclusive minimum and maximum
152156
const { exclusiveMinimum, exclusiveMaximum } = schemaObject;
153157
if (exclusiveMinimum !== undefined) {

0 commit comments

Comments
 (0)