From 78a126dde23bf6636a3d7edf790bd53ea9b3a1a9 Mon Sep 17 00:00:00 2001 From: Matheus Nogueira Date: Mon, 5 Jun 2023 16:52:49 -0300 Subject: [PATCH] update get tests endpoint to use resource manager --- api/openapi.yaml | 16 +++++++--------- api/tests.yaml | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index baaaf8c243..a646ad8732 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -305,7 +305,7 @@ paths: /tests: get: tags: - - api + - resource-api summary: "Get tests" description: "get tests" operationId: getTests @@ -318,17 +318,15 @@ paths: responses: 200: description: successful operation - headers: - X-Total-Count: - schema: - type: integer - description: Total records count content: application/json: schema: - type: array - items: - $ref: "./tests.yaml#/components/schemas/Test" + $ref: "./tests.yaml#/components/schemas/TestResourceList" + text/yaml: + schema: + $ref: "./tests.yaml#/components/schemas/TestResourceList" + 400: + description: "invalid query for test, some data was sent in incorrect format." 500: description: "problem with getting tests" post: diff --git a/api/tests.yaml b/api/tests.yaml index 094eedb876..fcc47f0a55 100644 --- a/api/tests.yaml +++ b/api/tests.yaml @@ -1,6 +1,29 @@ openapi: 3.0.0 components: schemas: + + TestResourceList: + type: object + properties: + count: + type: integer + items: + type: array + items: + $ref: "#/components/schemas/TestResource" + + TestResource: + type: object + description: "Represents a test structured into the Resources format." + properties: + type: + type: string + description: "Represents the type of this resource. It should always be set as 'Test'." + enum: + - Test + spec: + $ref: "#/components/schemas/Test" + Test: type: object properties: