-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Modify request body field #1735
Modify request body field #1735
Conversation
Since it is backward incompatible, we need to find another solution :( |
@matiasinsaurralde I wonder if we can inject some manual code to bindings we generate, so we add some byte->string conversion? |
@buger we could but we would need to do it everytime the bindings are re-generated and for the different languages? Also some people might be generating their own bindings |
What about plan on adding the second field, for compatibility? |
c4cbe62
to
fcf8aa9
Compare
I've refactored this and included a test that sends multipart data and a normal JSON request, the approach is as follows:
|
Nice! I would also suggest that probably raw_body should be populated all the time. So if you are writing a plugin you do not have to think about this logic of switching different fields. |
@buger Cool, will tweak it! |
fcf8aa9
to
0a9e575
Compare
Updated, |
0a9e575
to
c484424
Compare
Added gRPC tests and implemented a helper for dispatcher errors |
Now it looks really nice 👌 |
Solves #1724 however the Python bindings behave differently, if you had a middleware with the following code:
After this change it would throw this error:
It would need this small change:
The
request.object.body
field is generated automatically by the PB tool so I'm not sure if we should modify it?Bindings for other languages could be affected too.