1

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)?

1 Answer 1

2

If you are using Jackson library, You can use :

@JsonProperty("variable_name") // same name come from python app
private String variableName;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.