I have this LinkedHashMap {Label=BEER, ID=179039, URL=https://website.website.com/browse/178974/178973/179039, Children=[]}
I also have a JSONObject with a single ArrayList inside of it like this: {"Categories":[]}
I am trying to append this LinkedHashmap to the array inside of the JSONObject, something like this:
{"Categories":[{Label=BEER, ID=179039, URL=https://website.website.com/browse/178974/178973/179039, Children=[]}]}
However when i do, and i print to the console, this is the output {"Categories":[{"link":"","URL":"https:\/\/Website.Website.com\/browse\/178974\/178973\/179039","Children":[]}]}
As you can see, the URL has come out wrong, and I am unsure as to why. Here is my code:
LinkedHashMap<String,Object> jo=new LinkedHashMap<String,Object>();
jo.put("link", "");
jo.put("URL", "https://Website.Website.com/browse/178974/178973/179039");
jo.put("Children",new ArrayList<>());
List<LinkedHashMap<String,Object>> categories = new ArrayList<LinkedHashMap<String,Object>>();
categories.add(jo);
JSONObject ja1 = new JSONObject();
ja1.put("Categories",categories);
System.out.println(ja1);```
Note, this happens when I also simply just add the LinkedHashmap to the JSONObject EG:
{"Categories":{"link":"","URL":"https:\/\/Website.Website.com\/browse\/178974\/178973\/179039","Children":[]}}
I am using import org.json.simple.JSONObject;
Does anyone know why it is coming out incorrectly?