Skip to content

Commit

Permalink
fix: response schemas should be arrays
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <[email protected]>
  • Loading branch information
madpah committed Nov 18, 2024
1 parent dd1be0e commit 713ddbb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions spec/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ paths:
content: &id001
application/json:
schema:
$ref: '#/components/schemas/ComponentReport'
items:
$ref: '#/components/schemas/ComponentReport'
type: array
application/vnd.ossindex.component-report-request.v1+json:
schema:
$ref: '#/components/schemas/ComponentReport'
items:
$ref: '#/components/schemas/ComponentReport'
type: array
description: Vulnerability report for components
'400':
content: {}
Expand Down
10 changes: 8 additions & 2 deletions update-spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,18 @@
vuln_response = {
'application/json': {
'schema': {
'$ref': '#/components/schemas/ComponentReport'
'type': 'array',
'items': {
'$ref': '#/components/schemas/ComponentReport'
}
}
},
'application/vnd.ossindex.component-report-request.v1+json': {
'schema': {
'$ref': '#/components/schemas/ComponentReport'
'type': 'array',
'items': {
'$ref': '#/components/schemas/ComponentReport'
}
}
}
}
Expand Down

0 comments on commit 713ddbb

Please sign in to comment.