Specify missing response codes in API definition

This commit is contained in:
Jan-Eric Hellenberg
2021-05-18 12:10:56 +02:00
parent 5bb3c6745e
commit fd89139a33

View File

@ -3,7 +3,7 @@ info:
title: Poseidon API title: Poseidon API
description: | description: |
This API is used by CodeOcean to run code in runners. This API is used by CodeOcean to run code in runners.
version: '0.2.0' version: '0.2.1'
components: components:
schemas: schemas:
@ -53,10 +53,8 @@ components:
additionalProperties: false additionalProperties: false
responses: responses:
NotFound:
description: Not found
BadRequest: BadRequest:
description: Invalid request description: Request is invalid. E.g. request body does not follow the json schema required by the given route or url parameters are invalid.
content: content:
application/json: application/json:
schema: schema:
@ -65,6 +63,10 @@ components:
message: message:
description: Explanation on why the request is invalid description: Explanation on why the request is invalid
type: string type: string
Unauthorized:
description: Client could not be authenticated
NotFound:
description: The entity with the given identifier does not exist.
InternalServerError: InternalServerError:
description: Request could not be handled description: Request could not be handled
content: content:
@ -144,6 +146,10 @@ paths:
example: 123e4567-e89b-12d3-a456-426614174000 example: 123e4567-e89b-12d3-a456-426614174000
"400": "400":
$ref: "#/components/responses/BadRequest" $ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
"500": "500":
$ref: "#/components/responses/InternalServerError" $ref: "#/components/responses/InternalServerError"
@ -164,6 +170,8 @@ paths:
responses: responses:
"204": "204":
description: Success description: Success
"401":
$ref: "#/components/responses/Unauthorized"
"404": "404":
$ref: "#/components/responses/NotFound" $ref: "#/components/responses/NotFound"
"500": "500":
@ -221,6 +229,8 @@ paths:
description: All files were saved description: All files were saved
"400": "400":
$ref: "#/components/responses/BadRequest" $ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404": "404":
$ref: "#/components/responses/NotFound" $ref: "#/components/responses/NotFound"
"500": "500":
@ -283,6 +293,8 @@ paths:
example: "ws://ws.example.com/path/to/websocket" example: "ws://ws.example.com/path/to/websocket"
"400": "400":
$ref: "#/components/responses/BadRequest" $ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404": "404":
$ref: "#/components/responses/NotFound" $ref: "#/components/responses/NotFound"
"500": "500":
@ -307,6 +319,8 @@ paths:
type: array type: array
items: items:
$ref: "#/components/schemas/ExecutionEnvironment" $ref: "#/components/schemas/ExecutionEnvironment"
"401":
$ref: "#/components/responses/Unauthorized"
/execution-environments/{executionEnvironmentId}: /execution-environments/{executionEnvironmentId}:
parameters: parameters:
@ -330,6 +344,8 @@ paths:
$ref: "#/components/schemas/ExecutionEnvironment" $ref: "#/components/schemas/ExecutionEnvironment"
"400": "400":
$ref: "#/components/responses/BadRequest" $ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404": "404":
$ref: "#/components/responses/NotFound" $ref: "#/components/responses/NotFound"
put: put:
@ -351,8 +367,8 @@ paths:
description: The execution environment was replaced description: The execution environment was replaced
"400": "400":
$ref: "#/components/responses/BadRequest" $ref: "#/components/responses/BadRequest"
"404": "401":
$ref: "#/components/responses/NotFound" $ref: "#/components/responses/Unauthorized"
delete: delete:
summary: Delete the execution environment summary: Delete the execution environment
description: Remove the specified execution environment from the API. description: Remove the specified execution environment from the API.
@ -363,5 +379,7 @@ paths:
description: The execution environment was deleted. description: The execution environment was deleted.
"400": "400":
$ref: "#/components/responses/BadRequest" $ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404": "404":
$ref: "#/components/responses/NotFound" $ref: "#/components/responses/NotFound"