-
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
json Custom output support (with examples) #1051
Comments
I'm not sure I understand the question. As you've done in this example, you can use ForwardResponseMessage to configure the output. If you're unhappy with the JSON mapping of your field names, you need to go back to your proto files or your marshaller configuration. You maybe using If you need more help, please pop by the #grpc-gateway channel on Gophers slack and I can maybe help you understand what you're asking. |
Thank you for your answer. The current question is that ForwardResponseMessage function can not be replaced dynamically. It can only be implemented by hook. How should I replace ForwardResponseMessage dynamically? |
I suppose you could call another function in it which you can reassign to dynamically? It sounds like a pretty bad idea. What are you trying to do? I still think this would be easier to handle on slack. |
Implement runtime.WithProtoErrorHandler runtime.WithForwardResponseMessage similar function, I saw a night yesterday seems to need to change the main code or gohook can achieve the effect |
If you use runtime.WithForwardResponseOption(), multiple returns will be said. {"Error": 0, "Error": "Runs normally", } {// pbret} |
Is it possible to add runtime.ForwardResponseMessage here to support custom format json, such as "err": 0, "msg": "r ok", or convert them all to lowercase or uppercase This should be the right choice
The text was updated successfully, but these errors were encountered: