If the query type fails validation in this case type is not positive or negative, it should return a 400 (bad request) instead, it is returning 500 (server error).
Spec would say that this is a bad request and not a server error, a 400 response always means that it can return data about the failure to the end user while a 500 should be forbidden to return data to the end user.
Ref: Trailpack-router #61 Adding this issue so it is not forgotten about.
Essentially here's the problem: If I have a route, and I validate it's query.
If the query
type
fails validation in this casetype
is notpositive
ornegative
, it should return a 400 (bad request) instead, it is returning 500 (server error).Spec would say that this is a bad request and not a server error, a 400 response always means that it can return data about the failure to the end user while a 500 should be forbidden to return data to the end user.