-
Notifications
You must be signed in to change notification settings - Fork 124
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
mockModeNoCallback option and controller cache #51
base: master
Are you sure you want to change the base?
Conversation
mockModeNoCallback config option makes it possible for mockMode to behave more like the real deal. swagger examples show res.end() in the controllers while mock mode use cb(). This makes a huge difference for projects using custom fitters after the router.
cb(new Error(util.format('No controller found for %s in %j', controllerName, controllersDirs))); | ||
} | ||
}; | ||
response.setHeader('Content-Type', mimetype); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can someone please confirm if it's ok to use response.setHeader instead of context.headers[]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The best confirmation you'll get is a test that runs this code
options.ignoreMissingHandlers: [boolean] When false (default), a 500 is returned when a handler cannot be found. When true, we will ignore the missing handler and send the request downstream.
Thanks for your contribution. Would you be able to provide any tests to verify your work? |
I think it's a deceiving problem, we need to fix these examples. The fact that the examples assume there is no handler down the pipeline after them is not known to readers - hence the deception |
Please see my question about context.headers[] before merging.
after the router.
Sorry for the bundled pull request ;)