0

Simple but tricky, how could I convert com.google.gson.JsonObject to org.json.simple.JSONObject without know the inner properties or manually parsing?

1 Answer 1

2

My solution so far is use org.json.simple.parser.JSONParser to do it:

(JSONObject) new JSONParser().parse("{...}"); // JSON string generated via `com.google.gson.Gson`

Enjoy!

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.