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

Add support for supplying protojson Marshal options to json codec. #793

Open
jmmills opened this issue Oct 30, 2024 · 1 comment
Open

Add support for supplying protojson Marshal options to json codec. #793

jmmills opened this issue Oct 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jmmills
Copy link

jmmills commented Oct 30, 2024

Is your feature request related to a problem? Please describe.
For certain cases of javascript ecosystem interoperability it may be required to control certain behaviors for how json is rendered. protojson offers this via the MarshalOptions

Describe the solution you'd like
Offer the ability to either inject codec specific options via middleware and/or set default configuration on service startup.

Describe alternatives you've considered
Implementing a custom codec that does the same thing as the canonical json codec with the added ability to inject marshal options.

Additional context
It seems like the most useful options from the perspective of how data is rendered are EmitUnpopulated, EmitDefaultValues

@jmmills jmmills added the enhancement New feature or request label Oct 30, 2024
@jhump
Copy link
Member

jhump commented Oct 31, 2024

We've gotten a lot of feedback that folks would like to see that functionality in this core package and are taking it under consideration. In the meantime, there is a high-quality implementation of what you're looking for in this 3rd party package: https://github.com/akshayjshah/connectproto

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

No branches or pull requests

2 participants