Right now I have something like global static String readJson(String abc) { return abc;}
and when I POST a json {'abc':'success'}
, it returns the string success
.
Now if I have something with multiple levels of structure like:
{
"parking_spot": {
"0": {
"car": "car",
"color": "color",
"location_data": {
"0": {
"location": "building, level, spot",
"time_parked": "time"
}
}
}
}
I have two questions now:
1.) How would I set up the method parameters and deserialize it to read this?
2.) Is there any way to deal with reading and deserializing JSON given that I don't know the structure of the json in advance?
Thanks!