I need to send an object from my Python project to my Java project by JSON encoding it.
However, according to naming conventions, python has fields like
variable_name
while Java has fields like
private String variableName
How to encode the python object with the above variable (variable_name) in JSON, so that I can decode that JSON object into a Java model (having field as variableName)?
asked Nov 18, 2019 at 10:46
Dulanjaya Tennekoon
2,5181 gold badge20 silver badges33 bronze badges
1 Answer 1
If you are using Jackson library, You can use :
@JsonProperty("variable_name") // same name come from python app
private String variableName;
answered Nov 18, 2019 at 10:48
Youcef LAIDANI
60.3k21 gold badges112 silver badges178 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
default