Improve api schema

This commit is contained in:
Tobias Reisinger 2024-05-04 18:34:26 +02:00
commit f9ad8f9399
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
9 changed files with 123 additions and 164 deletions

View file

@ -6,17 +6,9 @@
"url": "https://git.serguzim.me/emgauwa/"
},
"title": "Emgauwa API v1",
"version": "0.5.0",
"version": "0.5.1",
"description": "Server API to manage an Emgauwa system."
},
"servers": [
{
"url": "http://localhost:4419"
},
{
"url": "https://testing.emgauwa.app/"
}
],
"tags": [
{
"name": "schedules"
@ -123,17 +115,6 @@
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"operationId": "get-schedules-schedule_id",
@ -154,28 +135,6 @@
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"operationId": "put-schedules-schedule_id",
@ -216,13 +175,24 @@
],
"responses": {
"200": {
"description": "OK"
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/message"
}
}
}
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"operationId": "delete-schedules-schedule_id",
@ -377,17 +347,6 @@
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"operationId": "get-controllers-controller_id",
@ -408,28 +367,6 @@
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"operationId": "put-controllers-controller_id",
@ -460,10 +397,14 @@
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found"
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/message"
}
}
}
}
},
"operationId": "delete-controllers-controller_id",
@ -501,17 +442,6 @@
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {}
}
}
}
}
},
"operationId": "get-controllers-controller_id-relays",
@ -553,21 +483,10 @@
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"operationId": "get-controllers-controller_id-relays-relay_num",
"description": "Return a single relay by number for a controller by id. When the relay or controller is not found, 404 will be returned."
"description": "Return a single relay by number for a controller by id. When either the relay or the controller is not found, 404 will be returned."
},
"put": {
"summary": "overwrite single relay for single controller",
@ -585,28 +504,6 @@
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"operationId": "put-controllers-controller_id-relays-relay_num",
@ -744,9 +641,6 @@
}
}
}
},
"404": {
"description": "Not Found"
}
},
"operationId": "get-tags-tag",
@ -757,10 +651,14 @@
"operationId": "delete-tags-tag",
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found"
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/message"
}
}
}
}
},
"description": "delete tag from database and from affected relays and schedules",
@ -792,10 +690,14 @@
"summary": "pulse relay on",
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found"
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/message"
}
}
}
}
},
"operationId": "post-controllers-controller_id-relays-relay_num-pulse",
@ -960,7 +862,7 @@
}
},
"operationId": "get-api-v1-macros-macro_id",
"description": "Return a single macro by id. When no macro with the id is found 404 will be returned."
"description": "Return a single macro by id."
},
"put": {
"summary": "overwrite a macro",
@ -1035,7 +937,14 @@
],
"responses": {
"200": {
"description": "OK"
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/message"
}
}
}
}
},
"operationId": "delete-api-v1-macros-macro_id",
@ -1067,10 +976,14 @@
],
"responses": {
"200": {
"description": "OK"
},
"404": {
"description": "Not Found"
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/message"
}
}
}
}
},
"operationId": "put-api-v1-macros-macro_id-execute",
@ -1085,7 +998,17 @@
],
"responses": {
"200": {
"description": "OK"
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/schedule"
}
}
}
}
}
},
"operationId": "post-schedules-list",
@ -1108,6 +1031,30 @@
},
"components": {
"schemas": {
"message": {
"title": "message",
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "action got handled"
}
}
},
"error": {
"title": "error",
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "bad input data"
},
"code": {
"type": "integer",
"example": 500
}
}
},
"controller": {
"title": "controller",
"type": "object",