From fafa50abfba70bd9662eafd51eccd7e03ed42f38 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Mon, 30 Oct 2023 11:23:45 +0100 Subject: [PATCH] update OpenAPI. Add examples and schemas for notus endpoint --- rust/doc/openapi.yml | 58 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/rust/doc/openapi.yml b/rust/doc/openapi.yml index 9336533ed1..1df1661b85 100644 --- a/rust/doc/openapi.yml +++ b/rust/doc/openapi.yml @@ -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": @@ -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" @@ -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", + ] + } + ]