-
Notifications
You must be signed in to change notification settings - Fork 328
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
Allow JSON lowerCamelCase names #299
Conversation
Twirp is not meant to have customizable serialization, but it makes sense to allow some basic settings for JSON. We should make sure to document what are the implications of enabling/disabling lower/camel case fields. |
Happy to add docs – were you thinking inline or in the |
Just inline on the server_options.go file. Seems good to me, I would review and help merge a PR with this functionality 👍 |
Thanks @marioizquierdo! This is a PR 😄 |
😅 never read Github prs/issues from your email. Gotcha! |
Okay. There are two things I would like to tighten before merging this one:
I will allocate some time this week to work through this, but this will slow down merging this PR. If you need this functionality now, you can operate from this branch, because the resulting "final" version will be very similar and easy update for you. The important thing is that we will eventually support camelCased fields in the JSON serialization. |
This all sounds great. No rush from my end and I'm also happy to put in some time to polish this up. I know you mentioned earlier that Twirp isn't meant to have customizable serialization, but if we're exploring arbitrary options anyway, one solution might be taking a page from gRPC's |
@marioizquierdo 👋 just rebased this to resolve conflicts from the v8 release |
Perfect! The next thing we need is to add the generic settings getter on the runtime library code, so we don't have to force library updates if clients include a new option. The issue #316 should have a PR implemented sometime in the next few weeks. Thank you so much for the patience! |
Here is the PR that allows adding backwards-compatible options: #319 |
@mterwill I fixed the conflicts with main for you. This PR should be ready now! Do you mind taking a last look before getting it ready for release? |
💯 looks great, thank you! |
Using |
Relates to #84. My organization has some tooling that expects lowerCamelCase fields and Twirp currently does not allow you configure this behavior. Mirrors implementation of similar option added in #271.