Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Not A Problem
-
2.5.0
-
None
-
None
Description
I want to be able to override with something like the annotation JsonProperty to override how a property name should be serialized to Json. If the feature is already there then please add documentation. For example:
@JsonProperty("test_one") int testOne @JsonProperty("test_two") int testTwo
More information on the example: Jackson-Annotations
Reproducible Code
Pojo.groovy
class Pojo { int testOne int testTwo }
Sample Run:
JsonOutput.toJson(new Pojo(testOne: 1, testTwo: 1)) // Output // ===> {"testTwo":1,"testOne":1}