-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support specifying explicit endpoint path for middleware instance #75
Conversation
….com/Zooz/express-ajv-swagger-validation into feature/36-support-explicit-routes
@kibertoad, i thought you wanted something to control the route through the middleware. like this app.post("/echo", validator.validate("post", "/echo"), (req, res, next) => {
res.json({ output: req.body.input });
}); btw, you'd only need to pass the request, as the middleware has access to the request method from req, so it would look like this. app.post("/echo", validator.validate({route: "/echo"}), (req, res, next) => {
res.json({ output: req.body.input });
}); anyway, as with this change we'll need a validate function that returns validate middleware so it could receive the configuration, this would be a breaking change. |
@kibertoad I have no problem with that |
@kobik Is everything ready for 1.0.0 then? |
@kibertoad i think we should close this MR for now and until we agree on how we solve it. |
@kobik Makes sense :) |
fixes #36
fixes #62
I would suggest reviewing #74 separately and first, since this once builds on what that PR introduces, but alternatively everything can be reviewed within this PR - it's a superset of #74.