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
I am using nestjs and I use the express-ajv-swagger-validation in the middleware (couldn't figure out how to do it otherwise in nestjs and I don't need routes).
I got a crash when calling swaggerValidator.validate(req, res, next) which I fixed by manually adding the route object to the request object:
req.route = {
path: req.path
};
Do you think its possible to check for the route property and if it does not exist use req.path? This would make express-ajv-swagger-validation a bit more flexible to use.
The text was updated successfully, but these errors were encountered:
I am using nestjs and I use the express-ajv-swagger-validation in the middleware (couldn't figure out how to do it otherwise in nestjs and I don't need routes).
I got a crash when calling
swaggerValidator.validate(req, res, next)
which I fixed by manually adding the route object to the request object:Do you think its possible to check for the route property and if it does not exist use req.path? This would make express-ajv-swagger-validation a bit more flexible to use.
The text was updated successfully, but these errors were encountered: