Closed caoxing9 closed 10 months ago
zodToJsonSchema( z .object({ tableId: z.number().optional(), recordId: z.string().uuid().optional(), }) .strict(), { target: 'openApi3', $refStrategy: 'none', } )
result:
{ type: 'object', properties: { tableId: { type: 'number' }, recordId: { type: 'string', format: 'uuid' } }, additionalProperties: false }
why doesn't get required ?
wow, i got it, only optional doesn's return required, my bad~
zodToJsonSchema( z .object({ tableId: z.number().optional(), recordId: z.string().uuid().optional(), }) .strict(), { target: 'openApi3', $refStrategy: 'none', } )
result:
why doesn't get required ?