Closed niallmccullagh closed 7 years ago
@theganyo do you have a timeframe for this to get pushed to NPM? I am also running into it. It's not deal breaking, but it is quite annoying (as I'm loading swagger-ui as well).
Yup, same here. Please push to NPM. Thanks!
You got it: swagger-node-runner@0.7.2
I've a error handler set up
swaggerExpress.runner.on('responseValidationError', function(validationResponse, request, response) { ... }
and I'm also serving up the swagger-ui using static serve.
However the hookResponseForValidation fails with
TypeError: Cannot read property 'validateResponse' of undefined api_1 | at ServerResponse.hookEnd (/app/node_modules/swagger-node-runner/lib/connect_middleware.js:163:63)
as
operation
is undefined oncontext.request.swagger.operation.validateResponse
I'll submit a pull request shortly but the gist of the change is to filter out based on
if(context.request.swagger.operation == undefined){ debug('not a swagger operation, will not validate response'); }