Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to validate a ReadableStream response? #119

Closed
thelinuxlich opened this issue Apr 30, 2024 · 3 comments
Closed

How to validate a ReadableStream response? #119

thelinuxlich opened this issue Apr 30, 2024 · 3 comments

Comments

@thelinuxlich
Copy link

thelinuxlich commented Apr 30, 2024

I see we have the file input case solved with latest Zod, but how can we have a ReadableStream output with a zod definition?

@StefanTerdell
Copy link
Owner

StefanTerdell commented May 2, 2024

Well, you cant really describe a stream object with json schema, so it would have to reflect the actual content. I take it the file contains binary and you dont want to deserialize it. You can represent the binary content as a base64 string and use z.string().base64(), which is now supported.

I'm not sure I understand your problem however. Can you provide some additional context?

@StefanTerdell
Copy link
Owner

@thelinuxlich Ok to close?

@thelinuxlich
Copy link
Author

Yeah I think it's probably something on Fastify schema validation side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants