I have a dilemma. Given a string with the following format:
{
"key1": "value1",
"key2": "value2",
"key3": {"a": "b", "c": "d"}
}
I would like to create a JSONObject in Java that treats the value of key3 as a string, rather than treating it as a nested JSONObject because transforming the value of key3 into a nested JSONObject distorts the order of the key value pairs which is important for me. I have tried googling and stackoverflowing around and have not found anyone running into a similar problem. Any ideas or suggestions? I am using org.json.
The ultimate goal should be to tell JSON treat all the values as strings and do not create any nested objects.