mirror of
https://github.com/goharbor/harbor
synced 2024-09-20 14:35:34 +00:00
fix(swagger): append scan report version 1.1 to swagger docs (#16965)
fix(swagger): append scan report version 1.1 to swagger docs default value The default value of swagger header X-Accept-Vulnerabilities should contains scan report version 1.0 and 1.1. Signed-off-by: chlins <chenyuzh@vmware.com>
This commit is contained in:
parent
e778ec2edf
commit
e08ad05659
|
@ -5610,7 +5610,7 @@ parameters:
|
|||
name: X-Accept-Vulnerabilities
|
||||
in: header
|
||||
type: string
|
||||
default: 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0'
|
||||
default: 'application/vnd.security.vulnerability.report; version=1.1, application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0'
|
||||
description: |-
|
||||
A comma-separated lists of MIME types for the scan report or scan summary. The first mime type will be used when the report found for it.
|
||||
Currently the mime type supports 'application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' and 'application/vnd.security.vulnerability.report; version=1.1'
|
||||
|
|
|
@ -116,7 +116,7 @@ func (suite *ArtifactTestSuite) TestGetVulnerabilitiesAddition() {
|
|||
suite.onGetReport(v1.MimeTypeNativeReport)
|
||||
|
||||
var body map[string]interface{}
|
||||
res, err := suite.GetJSON(url, &body)
|
||||
res, err := suite.GetJSON(url, &body, map[string]string{"X-Accept-Vulnerabilities": v1.MimeTypeNativeReport})
|
||||
suite.NoError(err)
|
||||
suite.Equal(200, res.StatusCode)
|
||||
suite.Empty(body)
|
||||
|
@ -127,7 +127,7 @@ func (suite *ArtifactTestSuite) TestGetVulnerabilitiesAddition() {
|
|||
suite.onGetReport(v1.MimeTypeNativeReport, suite.report1)
|
||||
|
||||
var body map[string]interface{}
|
||||
res, err := suite.GetJSON(url, &body)
|
||||
res, err := suite.GetJSON(url, &body, map[string]string{"X-Accept-Vulnerabilities": v1.MimeTypeNativeReport})
|
||||
suite.NoError(err)
|
||||
suite.Equal(200, res.StatusCode)
|
||||
suite.NotEmpty(body)
|
||||
|
|
Loading…
Reference in New Issue
Block a user