Skip to content

Commit

Permalink
chore: Updating OpenAPI missing entries (#3441)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar authored Dec 14, 2023
1 parent ddb68b4 commit 0e5a4ea
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 20 deletions.
25 changes: 22 additions & 3 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -290,6 +308,7 @@ paths:
- $ref: "./parameters.yaml#/components/parameters/testId"
summary: "get test"
description: "get test"
operationId: getTest
responses:
200:
description: successful operation
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion api/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ components:
properties:
id:
type: string
readOnly: true
name:
type: string
description:
Expand Down
52 changes: 36 additions & 16 deletions web/src/types/Generated.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -393,22 +383,52 @@ 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 */
400: unknown;
};
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 */
Expand All @@ -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"];
};
};
};
Expand Down

0 comments on commit 0e5a4ea

Please sign in to comment.