Repository navigation
Fix OpenAPI schema for paginated v3 package response variants - #2493
Open
Prachi194agrawal wants to merge 1 commit into
Open
Prachi194agrawal wants to merge 1 commit into
Prachi194agrawal wants to merge 1 commit into
Conversation
Signed-off-by: Prachi Agrawal <prachi194agrawal@gmail.com>
Prachi194agrawal
force-pushed
the
fix/your-change
branch
from
November 11, 2026 16:32
72f02ec to
e717ddf
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2331
POST /api/v3/packages/returns paginated PURL strings whendetails=falseand package objects whendetails=true. The schema currently describes only package objects, preventing generated clients from correctly handling both response formats.This change describes the paginated results using
oneOffor PURL strings and detailed package objects. It also documents nullable fields and conditional advisory lists or URLs in detailed responses.Adds regression tests that validate actual API responses against the generated OpenAPI schema, covering:
detailsmodes and empty results.max_advisoriesis exceeded.The tests also verify that the schema retains the correct HTTP 200 response.
Validation
venv/bin/python -m pytest vulnerabilities/tests/test_api_v3.py --reuse-db -qResult: 27 passed, 42 warnings.
