Seems like when an error occurs while processing the requests, the project simply returns an empty array as response. And if the query returns no matches, we also get the same response. So there's no way to tell whether a request was successful or not.
I suggest adding fields that provides us with status message and status code so that we know if the request was successful. And if it wasn't, what error was thrown.
Proposal:
{
"response": {
"result": [], // the array of responses
"isSuccessful": true, // boolean indicating weather the request succeeded or not
"errorMessage": "something happened" // message indicating what error occurred or null
}
}
Seems like when an error occurs while processing the requests, the project simply returns an empty array as response. And if the query returns no matches, we also get the same response. So there's no way to tell whether a request was successful or not.
I suggest adding fields that provides us with status message and status code so that we know if the request was successful. And if it wasn't, what error was thrown.
Proposal: