Closed pytlesk4 closed 2 years ago
@brendarearden we think this is already supported looking at the docs. Can you see if you can reproduce? If not, we can close this issue.
I was unable to reproduce this issue so it appears to have been resolved. I am able to get a 404 response with the following steps:
prism mock -d https://raw.githack.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml
curl -v http://127.0.0.1:4010/pets/123 -H "Prefer: code=404"
or
curl -v http://127.0.0.1:4010/pets/123\?__code\=404
...
[8:17:16 AM] › [NEGOTIATOR] ℹ info Unable to find a 404 response definition
[8:17:16 AM] › [NEGOTIATOR] ✔ success Found a compatible content for */*
[8:17:16 AM] › [NEGOTIATOR] ✔ success Responding with the requested status code 404
GET /pets/123?__code=404 HTTP/1.1 Host: 127.0.0.1:4010 User-Agent: curl/7.79.1 Accept: /
Summary
When dynamic mocking is enabled on the server, the bellow test should pass without disabling dynamic mocking. __code doesn't seem to be respected.
Questions