You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently middleware itself is responsible for determining path that is currently being accessed (let path = req.baseUrl.concat(req.route.path);). It would be helpful to be able to attach middleware to specific endpoints with predefined swagger path already filled during instantiation.
This is useful for Google Cloud Functions: while they seem to use Express under the hood and in general support swagger-style middleware, you can't attach middleware on app or router level and you don't have access to routing params, making usage of express-ajv-swagger-validation impossible.
@kibertoad sure, I would love to add this feature to the package.
if you do that, please also think about an option to enable validation only for specific routes in the current way we configure it.
Currently middleware itself is responsible for determining path that is currently being accessed (
let path = req.baseUrl.concat(req.route.path);
). It would be helpful to be able to attach middleware to specific endpoints with predefined swagger path already filled during instantiation.This is useful for Google Cloud Functions: while they seem to use Express under the hood and in general support swagger-style middleware, you can't attach middleware on app or router level and you don't have access to routing params, making usage of express-ajv-swagger-validation impossible.
Basically API could look like this:
The text was updated successfully, but these errors were encountered: