Closed zaucker closed 3 years ago
Changing the above if-statement to if ($self->version eq '3' and $status != 404)
would solve the problem for this example, but that is probably not the right thing to do ...
I'm not sure if my solution was less hackish than yours, but this is now fixed. Will be available on CPAN soon.
While the v2 example shown below runs successfully (all tests pass) in the v3 example the expected
404
error is "converted" to a500
error with messageNo responses rules defined for */*.
v2:
v3:
The "conversion" happens in
JSON::Validator::OpenAPI::Mojolicious::validate_response()
withWould this mean that the v3 schema is missing some kind of default specification? It seems wrong to me that a 404 is not reported as such to the user, but "hidden" behind a (in principal correct) missing spec error hiding the real problem. Or is this intentional? I couldn't find anything on that in the OpenAPI specs. BTW, the problem is the same if the specs contain
paths
specifications and an unknown route is being called.