Skip to content

Commit

Permalink
update OpenAPI. Add examples and schemas for notus endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Oct 30, 2023
1 parent 37a2e5b commit fafa50a
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions rust/doc/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,25 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/NotusPkgList"
examples:
schema:
description: "Schema of package list"
create simple scan:
$ref: "#/components/examples/notus_simple"
responses:
"204":
description: "Action performed"
"200":
description: "A list of results"
content:
application/json:
schema:
type: "array"
items:
$ref: "#/components/schemas/NotusResult"
examples:
schema:
description: "Schema of a list of results response"
get results 0-3:
$ref: "#/components/examples/notus_results"
"400":
description: "Bad request body"
"404":
Expand Down Expand Up @@ -634,6 +650,23 @@ components:
items:
$ref: "#/components/schemas/Parameter"

NotusResult:
description: "A result of a Notus run"
type: "object"
properties:
oid:
description: "Vulnerability OID"
type: "string"
package:
description: "Vulnerable Package"
type: "string"
package_fix:
description: "List of packages which fix the vulnerability"
type: array
items:
description: "A single packages which fix the vulnerability"
type: "string"

Result:
description: "A result of a Scan"
type: "object"
Expand Down Expand Up @@ -1078,3 +1111,24 @@ components:
"1.3.6.1.4.1.25623.1.0.10441",
"1.3.6.1.4.1.25623.1.0.100313",
]
notus_simple:
description: "A simple example for notus run."
value:
{
"message_type":"scan.start",
"package_list":["pkg1, pkg2, pkg3"]
}
notus_results:
description: "A simple example for notus run response including a vulnerable package list and their fix"
value:
[
{
oid: "1.3.6.1.4.1.25623.1.0.100196",
package: "pkg1",
package_fix:
[
"pkg1.2",
"pkg1.3",
]
}
]

0 comments on commit fafa50a

Please sign in to comment.