Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response validation occurs even when validateResponse is set to false #107

Open
randomcatgamer opened this issue Aug 8, 2017 · 0 comments

Comments

@randomcatgamer
Copy link

Hi there.

Seems that response validation is triggered even though it shouldn't:
_swagger_validate: name: swagger_validator validateResponse: false

Maybe it is important to mention that I set up a responseValidationError handler:
swaggerExpress.runner.on('responseValidationError', function(validationResponse, request, response) { config.logger.error('swagger validation error', validationResponse.errors); });

I noticed this bit of code in the connect_middleware.js as possible culprit:
var listenerCount = (runner.listenerCount) ? runner.listenerCount('responseValidationError') : // Node >= 4.0 EventEmitter.listenerCount(runner, 'responseValidationError'); // Node < 4.0 if (listenerCount) { hookResponseForValidation(context, runner); }

Am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant