friendsofgo/killgrave

Return bad request when you uses an invalid json schema

aperezg opened this issue · 3 comments

If you're declaring a json schema to validate to request body, when failed the mock could be more inteligent and return a 400 Bad Request instead to a 404 because the route is not found it.

Maybe we could add a param to handle this errors on the response... or return the error in a string in the response.

Hey,
I'd like to work on this.
I took a look and it seems the simplest way would be to move the logic from the matcher function returned by MatcherBySchema to the handler returned by ImposterHandler.

Sure, feel free to open a PR and to assign us to it as reviewers.
I'm glad to see you're interested in contributing into this project.
Looking forward to your contributions 😻

We finally discarded this idea. Feel free to open a new issue if you find this feature relevant.