PayU / openapi-validator-middleware

Input validation using Swagger (Open API) and ajv
Apache License 2.0
144 stars 50 forks source link

fix path finding in express #148

Open Kenblair1226 opened 3 years ago

Kenblair1226 commented 3 years ago

per https://github.com/PayU/openapi-validator-middleware/issues/81, borrow from @evelyne24's fix to use req.path if req.route does not exist.

kibertoad commented 3 years ago

could you please add new test and also check why ci is failing?

kibertoad commented 3 years ago

Still missing test :)

Kenblair1226 commented 3 years ago

Still missing test :)

Need to study testing framework a little bit...

kobik commented 3 years ago

@kibertoad anything else is missing?

kibertoad commented 3 years ago

@Kenblair1226 Would that work correctly when addressing parametrized routes? Wouldn't this result in passing ids etc as a part of route as well?

Kenblair1226 commented 3 years ago

Ya, the params will be treated as path and mostly be ignored since not matching any schema. Any suggestion?

kibertoad commented 3 years ago

@Kenblair1226 Something like this, I think: https://github.com/PayU/openapi-validator-middleware/pull/74