fullstorydev / fullstorydev/grpcurl
I want grpcurl responses to use the same JSON field keys as documented in proto
- Dominant language
- Go
- Stars
- 12.8k
- Forks
- 580
- Avg merge
- 1h 8m
- Merged PRs (30d)
- 5
Description
Given the following message in a protobuf file
```
message exampleMessage {
string example_field = 1
}
```
When I use grpcurl to test this service, I currently receive a response which includes lowerCamelCase field names. This is unexpected.
```
{
"exampleField": "foo"
}
```
I expect the grpcurl output to use the same field names in the JSON response as found in proto, so that I can make sense of the protobuf file as documentation. Returning different field names is confusing.
```
{
"example_field": "foo"
}
```
I've tracked the issue down to grpcurl's use of json marshaler. I found that ProtoJSON offers an option to use the original proto names: https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson; see UseProtoNames. I would like to option to enable display of original field names.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.