Closed theganyo closed 9 years ago
You're right, we should be explicitly setting res.statusCode
when we render the mock response. Since we fail to do that, and Hapi doesn't do it for us, we break the response validation code which assume res.statusCode
is set.
swagger-tools@0.9.4
has been released with this fix.
Specific case: Hapi appears to not set status code to 200 automatically (apparently the other frameworks do). Since swagger-tools validator relies on statusCode being set (
swagger-validator.js:224:41
), it should ensure that it explicitly sets statusCode when sending responses.See: https://github.com/swagger-api/swagger-node/issues/277