openapi-ts icon indicating copy to clipboard operation
openapi-ts copied to clipboard

Export `binary` string OpenAPI types using `z.file()` in zod v4

Open ntjess opened this issue 7 months ago • 5 comments

Description

Zod 4 now supports z.file() natively, which means OpenAPI specs referencing a Blob | File can have parity between zod/ts generation.

Current behavior is z.string(), which doesn't match the typescript definitions.

Hopefully this is a straightforward task especially if zod 4 is targeted by default.

ntjess avatar Aug 15 '25 03:08 ntjess

Do you want to open a pull request for this change? You may also want to read https://github.com/hey-api/openapi-ts/pull/1616 for additional context around this request, it's very similar

mrlubos avatar Aug 15 '25 07:08 mrlubos

Thanks for linking the context. Indeed, it brings up more considerations than I anticipated around input/output differences. Since my use case would be supported by a successful land of #1616 anyway, I'll wait on this until after the PR is merged.

I appreciate your work on this library! It's definitely the best API generator I've used and I'm excited by the continuous improvements 🙂

ntjess avatar Aug 17 '25 13:08 ntjess

Appreciate it! Much much more to come!

mrlubos avatar Aug 17 '25 14:08 mrlubos

much needed.

sahandsn avatar Oct 18 '25 09:10 sahandsn

any update in this issue?

edward-meister avatar Nov 02 '25 10:11 edward-meister