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

Vacuum misses path parameter on validation #492

Open
bitomaxsp opened this issue May 9, 2024 · 1 comment
Open

Vacuum misses path parameter on validation #492

bitomaxsp opened this issue May 9, 2024 · 1 comment
Labels
libopenapi a bug in libopenapi

Comments

@bitomaxsp
Copy link

bitomaxsp commented May 9, 2024

Hi Dave,
For the following endpoint with path parameter: /image-upload/{image-path} vacuum reports that

POST must define parameter image-path as expected by path /image-upload/{image-path}

Attached are lib and rule set.

I used the following command from vacuum repo root to reproduce it:
./bin/vacuum lint -d -r ruleset-recommended.yaml -p lib ./lib/typelib.yaml

lib.zip
ruleset-recommended.yaml.zip

@daveshanley daveshanley added the libopenapi a bug in libopenapi label May 17, 2024
@daveshanley
Copy link
Owner

This is a deep bug in libopenapi it's coming from the index and the rolodex. When the parameter is looked up when the parameter is deeply nested as a reference, the utility method scanOperationParams (https://github.com/pb33f/libopenapi/blob/main/index/utility_methods.go#L391) is not setting a context when looking up references, this means it does not know where it is in the recursion and when it looks in the rolodex (which has everything it needs) it's not finding it, because it's querying the rolodex from the wrong location.

This is a tricky one to fix, but i'll put some cycles into it when I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libopenapi a bug in libopenapi
Projects
None yet
Development

No branches or pull requests

2 participants