diff --git a/api/openapi.yaml b/api/openapi.yaml index 85fb6781c8..b0763c68d8 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -272,16 +272,34 @@ paths: content: application/json: schema: - $ref: "./tests.yaml#/components/schemas/Test" + $ref: "./tests.yaml#/components/schemas/TestResource" responses: 200: description: successful operation content: application/json: schema: - $ref: "./tests.yaml#/components/schemas/Test" + $ref: "./tests.yaml#/components/schemas/TestResource" 400: description: "trying to create a test with an already existing ID" + put: + tags: + - resource-api + summary: "Upsert new test" + description: "Upsert new test action" + operationId: upsertTest + requestBody: + content: + application/json: + schema: + $ref: "./tests.yaml#/components/schemas/TestResource" + responses: + 200: + description: successful operation + content: + application/json: + schema: + $ref: "./tests.yaml#/components/schemas/TestResource" /tests/{testId}: get: tags: @@ -290,6 +308,7 @@ paths: - $ref: "./parameters.yaml#/components/parameters/testId" summary: "get test" description: "get test" + operationId: getTest responses: 200: description: successful operation @@ -311,7 +330,7 @@ paths: content: application/json: schema: - $ref: "./tests.yaml#/components/schemas/Test" + $ref: "./tests.yaml#/components/schemas/TestResource" responses: 204: description: successful operation diff --git a/api/tests.yaml b/api/tests.yaml index 236de0010c..362df96371 100644 --- a/api/tests.yaml +++ b/api/tests.yaml @@ -28,7 +28,6 @@ components: properties: id: type: string - readOnly: true name: type: string description: diff --git a/web/src/types/Generated.types.ts b/web/src/types/Generated.types.ts index b38c6d33ab..9e76a258ad 100644 --- a/web/src/types/Generated.types.ts +++ b/web/src/types/Generated.types.ts @@ -37,24 +37,14 @@ export interface paths { "/tests": { /** get tests */ get: operations["getTests"]; + /** Upsert new test action */ + put: operations["upsertTest"]; /** Create new test action */ post: operations["createTest"]; }; "/tests/{testId}": { /** get test */ - get: { - parameters: {}; - responses: { - /** successful operation */ - 200: { - content: { - "application/json": external["tests.yaml"]["components"]["schemas"]["TestResource"]; - }; - }; - /** problem with getting a test */ - 500: unknown; - }; - }; + get: operations["getTest"]; /** update test action */ put: operations["updateTest"]; /** delete a test */ @@ -393,13 +383,29 @@ export interface operations { 500: unknown; }; }; + /** Upsert new test action */ + upsertTest: { + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["tests.yaml"]["components"]["schemas"]["TestResource"]; + }; + }; + }; + requestBody: { + content: { + "application/json": external["tests.yaml"]["components"]["schemas"]["TestResource"]; + }; + }; + }; /** Create new test action */ createTest: { responses: { /** successful operation */ 200: { content: { - "application/json": external["tests.yaml"]["components"]["schemas"]["Test"]; + "application/json": external["tests.yaml"]["components"]["schemas"]["TestResource"]; }; }; /** trying to create a test with an already existing ID */ @@ -407,8 +413,22 @@ export interface operations { }; requestBody: { content: { - "application/json": external["tests.yaml"]["components"]["schemas"]["Test"]; + "application/json": external["tests.yaml"]["components"]["schemas"]["TestResource"]; + }; + }; + }; + /** get test */ + getTest: { + parameters: {}; + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["tests.yaml"]["components"]["schemas"]["TestResource"]; + }; }; + /** problem with getting a test */ + 500: unknown; }; }; /** update test action */ @@ -422,7 +442,7 @@ export interface operations { }; requestBody: { content: { - "application/json": external["tests.yaml"]["components"]["schemas"]["Test"]; + "application/json": external["tests.yaml"]["components"]["schemas"]["TestResource"]; }; }; };