Skip to content

Encode response schema#239

Open
appellation wants to merge 1 commit intoturkerdev:mainfrom
appellation:will/encode-response
Open

Encode response schema#239
appellation wants to merge 1 commit intoturkerdev:mainfrom
appellation:will/encode-response

Conversation

@appellation
Copy link
Copy Markdown

Fixes #211

Unfortunately I think this would probably be a breaking change since users of codecs could see significantly different serialization behavior.

@Bram-dc
Copy link
Copy Markdown
Contributor

Bram-dc commented Jan 24, 2026

Should we also use decode instead of parse on the input fields?

@Bram-dc
Copy link
Copy Markdown
Contributor

Bram-dc commented Jan 25, 2026

I’m planning to create a fork that includes my changes along with these updates.

@turkerdev @kibertoad — would you be open to adding me as a reviewer at some point so I can help with ongoing maintenance? Happy to assist with PRs, issues, and upkeep if that’s useful.

Thanks for the work on this project!

@Bram-dc
Copy link
Copy Markdown
Contributor

Bram-dc commented Jan 25, 2026

Should we also use decode instead of parse on the input fields?

I've changed this aswell:
main...Bram-dc:fastify-type-provider-zod:main

https://www.npmjs.com/package/@bram-dc/fastify-type-provider-zod

@Bram-dc Bram-dc mentioned this pull request Jan 25, 2026
@appellation
Copy link
Copy Markdown
Author

appellation commented Jan 30, 2026

Sorry for the delay, I've been out for the past few days. If you're already working on that then please feel free to bundle this change into it.

That said, I don't think that we need to decode the input. decode and parse accomplish the same thing, the only difference being that decode is typed to accept the input type rather than unknown. Given that the input is the request body, it seems reasonable to just stick with parse.

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

Successfully merging this pull request may close these issues.

zod/v4: should be using .encode() for serializerCompiler

2 participants