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
While trying the new ?concelho= query string parameter for the V2 of the api I get the same response even if the query string is invalid or does not exist. All requests return, even when adding special or random characters after the =:
{
"success": true,
"data": []
}
If I request https://api-dev.fogos.pt/v2/incidents/active?concelho=??? I would expect the API to resolve a failure in the 4xx error code range, since the request is semantically incorrect.
So the question is: should the API return a 4xx response informing the client that the request was invalid, or should the API perform the listing of the items as if no filter parameter was supplied? If we think of the query string parameter as a direct listing request to resources, my answer would be that requesting a resource (concelho=???) that does not exist should return a 404 or 400.
I found 2 articles on SO that support this discussion:
While trying the new
?concelho=
query string parameter for theV2
of the api I get the same response even if the query string is invalid or does not exist. All requests return, even when adding special or random characters after the=
:If I request
https://api-dev.fogos.pt/v2/incidents/active?concelho=???
I would expect the API to resolve a failure in the4xx
error code range, since the request is semantically incorrect.So the question is: should the API return a 4xx response informing the client that the request was invalid, or should the API perform the listing of the items as if no filter parameter was supplied? If we think of the query string parameter as a direct listing request to resources, my answer would be that requesting a resource (
concelho=???
) that does not exist should return a 404 or 400.I found 2 articles on SO that support this discussion:
Let me know your thoughts about the ideal behaviour and what clients expect from the response. Thanks 👍🏽
The text was updated successfully, but these errors were encountered: