-1

I have some JSON as below

{
  "FName": "Test",
  "LName": "Test"
}

When i use json2pojo maven plugin(0.4.37), the POJOs are created with the proper Java naming conventions(like fName,lName). Is there a way to override this and create the POJOs with the same names (like FName, LName).

budi
  • 6,351
  • 10
  • 55
  • 80
Jack
  • 1
  • Hi and welcome to Stack Overflow, please take a time to go through the [welcome tour](https://stackoverflow.com/tour) to know your way around here (and also to earn your first badge), read how to create a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and also check [How to Ask Good Questions](https://stackoverflow.com/help/how-to-ask) so you increase your chances to get feedback and useful answers. – DarkCygnus Jul 19 '17 at 15:45

1 Answers1

0

Annotate your fields with @JsonProperty() annotation

import com.fasterxml.jackson.annotation.JsonProperty;    
class SomeClass {
  @JsonProperty("FName")
  private String fName;

  @JsonProperty("LName")
  @private String lName;

  //getters and setters 
}
Jinu P C
  • 3,146
  • 1
  • 20
  • 29