'Protocol Buffer JSONFormat upper camelCase issue
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.9.2</version>
</dependency>
message MyObject{
bool Test= 1;}
String json = JsonFormat.printer().print(myObject.toBuilder());
// System.out.println(json);
This is printing {"Test": true}
Instead of {"test": true}. The documentation protobuf-java-util JSONFormat says it will be lower CamelCase for protocol Buffer version 3. How to fix this to get lowercase field names?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|