Skip to content

Commit

Permalink
update get tests endpoint to use resource manager
Browse files Browse the repository at this point in the history
  • Loading branch information
mathnogueira committed Jun 5, 2023
1 parent f4ce24a commit 78a126d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
16 changes: 7 additions & 9 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ paths:
/tests:
get:
tags:
- api
- resource-api
summary: "Get tests"
description: "get tests"
operationId: getTests
Expand All @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions api/tests.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 78a126d

Please sign in to comment.