How can I filter or search a json object depending on an object on an array inside an json object, for example:
I was trying to clear a little bit my code and wanna rearrange my apis like a json object:
readonly property var mApis:[
{
"id":"login",
"url":"/path/to/login",
"errors":[
{
" code":404,
" msg":"User not found"
},
{
"code":405,
"msg":"User suspendend"
}
]
} ,
...
...
]
How can I get the error message 405 for the api ‘login’? I know that there is the method indexOF(‘id’,’login’) and maybe loop through the errors array content until find it, but isn’t a more direct way to do this?