Skip to content
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

Support for json_name in HttpJsonTranscodingQueryParamMatchRule #5193

Closed
ikhoon opened this issue Sep 20, 2023 · 0 comments · Fixed by #5366
Closed

Support for json_name in HttpJsonTranscodingQueryParamMatchRule #5193

ikhoon opened this issue Sep 20, 2023 · 0 comments · Fixed by #5366
Labels

Comments

@ikhoon
Copy link
Contributor

ikhoon commented Sep 20, 2023

Currently, LOWER_CAMEL_CASE and ORIGINAL_FIELD are used to match query params with protobuf messages.

LOWER_CAMEL_CASE,
/**
* Uses the original fields in .proto files to match {@link QueryParams} of an {@link HttpRequest}.
*/
ORIGINAL_FIELD

It would be nicer if HttpJsonTranscodingQueryParamMatchRule supports json_name field option which is a well-known option that most protobuf JSON codecs implement. https://hexdocs.pm/protobuf/Protobuf.JSON.html

ikhoon pushed a commit that referenced this issue Jan 24, 2024
Motivation:

Currently, LOWER_CAMEL_CASE and ORIGINAL_FIELD are used to match query
params with protobuf messages.
It would be nicer if HttpJsonTranscodingQueryParamMatchRule supports
json_name field option which is a well-known option that most protobuf
JSON codecs implement

Modifications:

- Support for json_name in HttpJsonTranscodingQueryParamMatchRule
- The json name of the field is camelcase by default. so, it is
supported both when it is a camel case and when it is not.
( If json name is used, the default is origin field.
https://protobuf.dev/programming-guides/proto3/#json)

Result:

- Closes #5193
- Respect json_name if specified.
@ikhoon ikhoon added defect and removed new feature labels Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant