-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
bug: grpc-transcode plugin, in Protobuf, when there is a field of type int64, when 'a' is passed in, it is converted to 10. #11355
Comments
Hi @Jamel-jun , Maybe there is a minor problem of lua-protobuf while converting integer from a series of string patterns. BTW & FYIIt seems that it's the ability of lua-protobuf to support INT string patterns like "#123666666", "#0x+123abc", "+123", "-#123666666", ... As a contrast, https://pkg.go.dev/mod/google.golang.org/protobuf/encoding/protojson only support a few types, e.g. "123", "-123". I suggest that we should
Some test snippets and outputsSimulate The Flow of
|
Current Behavior
I only used the grpc-transcode plugin.

I customized a protobuf, which contains an int64 type field.
When I make a call through HTTP, I given in.
When parsed to the backend, the value equals 10.
Expected Behavior
Assigning the value as 10 is incorrect; it should only accept numerical types.
I want it to throw an exception when a non-numerical type is inputted, for example, a 400 Bad Request error.
Error Logs
No response
Steps to Reproduce
This scene is inevitable
Environment
apisix version
):uname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: