You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I worked on JSON Minimal in recent time. Some things look good.
But for now. I got the JSON as below:
{
"status": "OK",
"result": {
"user": [
{
"_id": "123",
"type": "worker"
},
{
"_id": "129",
"type": "architect"
}
]
}
}
For now, I want to get data from each of key "_id". For the first. I tried to implement JsonArray as below:
JsonObject JsonObject = JsonObject.readFrom( jsonString );
JsonArray items = jsonObject.get( "result.user" ).asArray();
Then get the exception:
**javax.script.ScriptException: Sourced file: inline evaluation of: ``import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonObjec . . . '' : Typed variable declaration : Attempt to resolve method: get() on undefined variable or class name: jsonObject : at Line: 9 : in file: inline evaluation of: ``import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonObjec . . . '' : jsonObject .get ( "result.account" )
in inline evaluation of: ``import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonObjec . . .**
I think look like the format Json node "result.user" doesn't follow to standard JSON Minimal. Please let me know if you has any the way to define code for better in behavior to print each of "_id" value from the JSON above
Many thanks
The text was updated successfully, but these errors were encountered:
Hi team,
I worked on JSON Minimal in recent time. Some things look good.
But for now. I got the JSON as below:
{
"status": "OK",
"result": {
"user": [
{
"_id": "123",
"type": "worker"
},
{
"_id": "129",
"type": "architect"
}
]
}
}
For now, I want to get data from each of key "_id". For the first. I tried to implement JsonArray as below:
The text was updated successfully, but these errors were encountered: