Skip to content
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

how ignorePaths work? #245

Closed
mirekgw opened this issue Feb 25, 2020 · 4 comments
Closed

how ignorePaths work? #245

mirekgw opened this issue Feb 25, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mirekgw
Copy link
Contributor

mirekgw commented Feb 25, 2020

I'm trying to not validate request data for specific path and I was trying to use ignorePaths, but it seems it's not working as I tough.

I have a path in openapi .yaml file that I would like to exclude from body verification. But I would still like to use param parsing that openapi validator is doing (in applyOpenApiMetadata function).

I'm seeing when request is processed that lookupRoute() in applyOpenApiMetadata() is matching my request and code never goes into openApiContext.isManagedRoute, and that is the only place where ignorePaths is used.

My assumption is that fix for this problem may be that ignorePaths property is checked in buildMiddleware() or maybe in validate() function in openapi.request.validator.js

Could you please explain how ignorePaths should work as documentation is very brief.
Thanks

@cdimascio cdimascio added the bug Something isn't working label Feb 25, 2020
@cdimascio
Copy link
Owner

thanks @mirekgw , just checked the codeignorePaths is broken. the test cases are also broken and incorrectly pass. we'll have a look.

cdimascio pushed a commit that referenced this issue Feb 25, 2020
@cdimascio cdimascio self-assigned this Feb 25, 2020
@cdimascio
Copy link
Owner

cdimascio commented Feb 25, 2020

should have a fix soon see #247
in terms of intended behavior... provide a regex to ignorePaths. Path matched by the regex will be ignored.

cdimascio added a commit that referenced this issue Feb 25, 2020
@cdimascio
Copy link
Owner

fix is in v3.9.1

@cdimascio
Copy link
Owner

@mirekgw did you have success with the fix? Note, i also made some updates to the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants