-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: deserialize relationships filter from query params #1256
Conversation
Fixes trustification#1232 Signed-off-by: Jim Crossley <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the openapi client will genereate requests that look like:
http://localhost:3000/api/v2/analysis/component/test?ancestors=10&relationships[]=contains&relationships[]=dependency
Any chance we could parse that?
Ah shit maybe we just need to fix the test to do it the openapi way!.. |
@jcrossley3 I think you can close, #1257 is the simple fix. |
Ideally, there'd be a way to ref the values in the Relationship enum, but I didn't see an obvious way to do that. Signed-off-by: Jim Crossley <[email protected]>
I agree that fix is simple, but it changes the test, and it forces me to remember to add |
Signed-off-by: Jim Crossley <[email protected]>
My understanding from the internal chat is that we need to pass an array of values through the query params. From my experience:
/api/v2/vulnerability?limit=10&offset=0&q=average_severity=low|medium|high|critical Notice that there is a variable |
@carlosthe19916 so the js openapi client can already pass the array with a js call like:
where the relationships field is defined as: The above would generate this URL: But sadly this PR breaks the above but in exchange, users gain the ability to manually construct URLs easier. #1257 keeps the openapi interface working and also supports constructing the URL easy by adding a new field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! and thx for litigating the whole conversation on this!
Dismissing in light of 1257 being closed -- not sure this PR is our final answer but it's an evolutionary step.
Fixes #1232