Skip to content

Commit 713ddbb

Browse files
committed
fix: response schemas should be arrays
Signed-off-by: Paul Horton <[email protected]>
1 parent dd1be0e commit 713ddbb

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

spec/openapi.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,14 @@ paths:
137137
content: &id001
138138
application/json:
139139
schema:
140-
$ref: '#/components/schemas/ComponentReport'
140+
items:
141+
$ref: '#/components/schemas/ComponentReport'
142+
type: array
141143
application/vnd.ossindex.component-report-request.v1+json:
142144
schema:
143-
$ref: '#/components/schemas/ComponentReport'
145+
items:
146+
$ref: '#/components/schemas/ComponentReport'
147+
type: array
144148
description: Vulnerability report for components
145149
'400':
146150
content: {}

update-spec.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,18 @@
7373
vuln_response = {
7474
'application/json': {
7575
'schema': {
76-
'$ref': '#/components/schemas/ComponentReport'
76+
'type': 'array',
77+
'items': {
78+
'$ref': '#/components/schemas/ComponentReport'
79+
}
7780
}
7881
},
7982
'application/vnd.ossindex.component-report-request.v1+json': {
8083
'schema': {
81-
'$ref': '#/components/schemas/ComponentReport'
84+
'type': 'array',
85+
'items': {
86+
'$ref': '#/components/schemas/ComponentReport'
87+
}
8288
}
8389
}
8490
}

0 commit comments

Comments
 (0)