-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Comments
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? |
does it possible to modify EmitDefaults per Service in runtime.NewServeMux ? |
i have compat api and new api. In compat i need to EmitDefaults: true, but in new - not |
@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. |
thanks, but how to deal with two different ServeMux in one http.Server ? |
https://github.com/mennanov/fieldmask-utils this is works fine |
Closing this as OP seems inactive. |
No description provided.
The text was updated successfully, but these errors were encountered: