Open JeanMarcGoepfert opened 7 years ago
This is just how the mock functionality was written. The mocking support was just an initial pass with no input from anyone else. We could potentially just use some convention for identifying which response to use instead of hard coding them.
How about just returning the first 2XX
status? I've done that here which seems to work. If you're ok with that approach I'm happy to make a PR with some tests/updated docs.
Hi, thanks for this project!
I'm running into an issue with swagger router running in mock mode.
I have some definitions that have
PUT
andPOST
methods that should return a204
status according to their definitions, but the mock response comes back with a status of200
.It looks like this is intentionally done here: https://github.com/apigee-127/swagger-tools/blob/master/middleware/swagger-router.js#L280 where the status will only get set to 204 for requests with a
DELETE
method. Other requests get set to a default of200
.I can't find any information about why
204
responses aren't allowed forPUT/POST
requests, so is this a case that can be added? I'm happy to submit a PR.Thanks!