Description
Hi there!
Our team started using the latest version of the packages after the merger of #206 (thanks for that!)
We noticed a small issue (but quite consequential) when it comes to nullable properties. I'll try to explain what we're facing in an example, but also dropped a full diff of our spec after migrating to @anatine/zod-openapi
. I'm currently assuming it's an issue only when using patchNestjsSwagger
with 3.0
.
Here's a schema:
export const ContinuationTokenSchema = z.object({
continuation: z.string().nullish().default(null),
});
This schema results in the following OpenAPI output:
"continuation": {
"default": null,
"type": "null"
},
While we are actually expecting it to be:
"continuation": {
"type": "string"
"default: null,
"nullable": true
},
It happens for all sorts of schema: arrays, booleans, strings - below you will find a link to our OpenAPI spec after migrating to @anatine/zod-openapi
(left isnestjs-zod
, right is @anatine/zod-openapi
)
https://www.diffchecker.com/Zg4nfCdt/