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

Is there any way we can remove fields from the response json in grpc-gateway? #710

Closed
chaitanya9186 opened this issue Jul 29, 2018 · 7 comments

Comments

@chaitanya9186
Copy link

No description provided.

@johanbrandhorst
Copy link
Collaborator

If you set your marshaller to not EmitDefaults, and then return the zero value of that field, it will not be included in the returned JSON.

This begs the question though, what are you trying to do here?

@vtolstov
Copy link

does it possible to modify EmitDefaults per Service in runtime.NewServeMux ?

@vtolstov
Copy link

i have compat api and new api. In compat i need to EmitDefaults: true, but in new - not

@johanbrandhorst
Copy link
Collaborator

@vtolstov No, I'm afraid you'll have to create a separate ServeMux with the other settings and register your service to that ServeMux instead.

@vtolstov
Copy link

thanks, but how to deal with two different ServeMux in one http.Server ?

@vtolstov
Copy link

https://github.com/mennanov/fieldmask-utils this is works fine

@johanbrandhorst
Copy link
Collaborator

Closing this as OP seems inactive.

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

3 participants