Closed guyariely closed 1 month ago
Describe the bug String format (for example date, url, email, etc.) is ignored when it's an item in an array.
Minimal reproduction A minimal OAS document to show this:
openapi: 3.0.0 info: version: 1.0.0 title: Swagger Petstore license: name: MIT servers: - url: 'http://petstore.swagger.io/v1' paths: /example: parameters: [] get: summary: Example tags: [] responses: '200': description: OK content: application/json: schema: type: object properties: date: type: string format: date-time dates: type: array items: type: string format: date-time required: - date - dates
The output is:
const endpoints = makeApi([ { method: "get", path: "/example", alias: "getExample", requestFormat: "json", response: z .object({ date: z.string().datetime({ offset: true }), dates: z.array(z.string()), }) .passthrough(), }, ]);
Expected behavior
When a string is an item in an array it should still have format validation.
Describe the bug String format (for example date, url, email, etc.) is ignored when it's an item in an array.
Minimal reproduction A minimal OAS document to show this:
The output is:
Expected behavior
When a string is an item in an array it should still have format validation.