Closed omartell closed 3 years ago
Hi Oliver,
No, there's nothing that does response validation at the moment. It should be fairly straightforward to write an interceptor to do so - I think you would want to use schema's cond-pre
to choose the right schema based on the status code of the response. If you write this I would happily accept a PR or gist.
The only use of the response schemas at the moment is for documentation in explore
as you've already seen and for generating responses in martian-test.
Hi @omartell
This is added in 0.1.15, enjoy :)
Cheers
Nice one @oliyh.
Hey Oliy,
I was trying to figure out how to do response validation when doing the manual endpoint definition, but couldn't find it in the documentation. I had a look around the code and all I could see was a key called
:response-schemas
used by theexplore
call, but that didn't seem to trigger any validation. Is this supported? or do I need a different incantation?Cheers, Oliver