File tree 2 files changed +35
-4
lines changed
2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -115,8 +115,9 @@ info:
115
115
license :
116
116
name : Apache 2.0
117
117
url : http://www.apache.org/licenses/LICENSE-2.0.html
118
+ termsOfService : https://ossindex.sonatype.org/tos
118
119
title : Sonatype OSS Index
119
- version : ' 2024.320 '
120
+ version : ' 2024.323 '
120
121
openapi : 3.0.1
121
122
paths :
122
123
/api/v3/authorized/component-report :
@@ -133,7 +134,13 @@ paths:
133
134
required : false
134
135
responses :
135
136
' 200 ' :
136
- content : {}
137
+ content : &id001
138
+ application/json :
139
+ schema :
140
+ $ref : ' #/components/schemas/ComponentReport'
141
+ application/vnd.ossindex.component-report-request.v1+json :
142
+ schema :
143
+ $ref : ' #/components/schemas/ComponentReport'
137
144
description : Vulnerability report for components
138
145
' 400 ' :
139
146
content : {}
@@ -162,7 +169,7 @@ paths:
162
169
required : false
163
170
responses :
164
171
' 200 ' :
165
- content : {}
172
+ content : *id001
166
173
description : Vulnerability report for components
167
174
' 400 ' :
168
175
content : {}
@@ -191,7 +198,7 @@ paths:
191
198
tags :
192
199
- Version
193
200
servers :
194
- - url : /
201
+ - url : https://ossindex.sonatype.org
195
202
tags :
196
203
- name : Component vulnerability reports
197
204
- name : Version
Original file line number Diff line number Diff line change 58
58
'name' : 'Apache 2.0' ,
59
59
'url' : 'http://www.apache.org/licenses/LICENSE-2.0.html'
60
60
},
61
+ 'termsOfService' : 'https://ossindex.sonatype.org/tos' ,
61
62
'version' : OSS_INDEX_API_VERSION
62
63
}
63
64
65
+ print ('Injecting correct `servers`' )
66
+ json_spec ['servers' ] = [
67
+ {
68
+ 'url' : 'https://ossindex.sonatype.org'
69
+ }
70
+ ]
71
+
72
+ # Fix Response Schemas
73
+ vuln_response = {
74
+ 'application/json' : {
75
+ 'schema' : {
76
+ '$ref' : '#/components/schemas/ComponentReport'
77
+ }
78
+ },
79
+ 'application/vnd.ossindex.component-report-request.v1+json' : {
80
+ 'schema' : {
81
+ '$ref' : '#/components/schemas/ComponentReport'
82
+ }
83
+ }
84
+ }
85
+ json_spec ['paths' ]['/api/v3/component-report' ]['post' ]['responses' ]['200' ]['content' ] = vuln_response
86
+ json_spec ['paths' ]['/api/v3/authorized/component-report' ]['post' ]['responses' ]['200' ]['content' ] = vuln_response
87
+
64
88
# Add `securitySchemes` under `components`
65
89
if 'components' in json_spec and 'securitySchemes' in json_spec ['components' ] and 'basicAuth' not in \
66
90
json_spec ['components' ]['securitySchemes' ]:
You can’t perform that action at this time.
0 commit comments