-
Notifications
You must be signed in to change notification settings - Fork 922
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 transcoding has backwards incompatible change in 1.27.0, due to json_name field always populated by protoc #5890
Comments
Any update on this? I'm currently stuck on 1.26.4 due to this. |
It makes sense. We may provide a new option to ignore |
I've compiled a proto file with protoc 3.25.1 and Line 119 in 683bd74
Was that bug fixed in recent versions or am I missing something to reproduce the problem? |
For us it doesn't seem fixed. We have a custom interceptor, but this now gets a complete empty (ReqT message) argument when using transcoding. |
Hi @ikhoon, If you add a plugin you will see the filled in Thanks! |
I failed to reproduce the problem by configuring https://github.com/bufbuild/protoc-gen-validate. Would you provide a minimal reproducible example? The example should be useful for preventing regression and ensuring compatibility. |
Issue: explicitly need to set json_name in proto file to enable trancoding. I've made a minimal repo that reproduces the issue. Note it is build using bazel, but with all previously specified versions as per this issue.
This proto compiled to java and then used by armeria:1.26 with transcoding results in the following service printing "Hello, mbgit2!". However with all the same in armeria:1.30 it prints "Hello, !". The incoming HelloRequest is empty, unless we specify the json_name, see the commented line in the proto file.
We would really like to have the 1.26 behavior such that it is not necessary to put the json_name everywhere explicitly. Thanks for your time. |
Hi,
In #5193 functionality was added so that if a user sets the
json_name
field in the .proto file explicitly, it is used to resolve the path & query params when doing transcoding. This makes perfect sense, if it weren't for a bug in protoc: the proto compiler always populates the json_name field since 3.1.0.This means that to retain our existing behaviour (using the original field which might contain underscores) we have to add
json_name = <field_name>
to all our proto definitions.The Protobuf code base also acknowledges it as a bug and has a workaround to deal with it.
I suppose Armeria needs to use the same workaround as the protobuf codebase: if the
json_name
that is set is the same as the default calculated one, assume it was not set explicitly by the user.Thanks!
The text was updated successfully, but these errors were encountered: