From 1476e9da389ce11f5ffaa3efadfa20abc7c0c098 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 11 Nov 2024 14:48:44 +0800 Subject: [PATCH] Update swagger docs --- Server/openapi.json | 131 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/Server/openapi.json b/Server/openapi.json index 5d2d512e6..7ba2fc222 100644 --- a/Server/openapi.json +++ b/Server/openapi.json @@ -84,6 +84,10 @@ { "name": "queue", "description": "Queue" + }, + { + "name": "status-page", + "description": "Status Page" } ], "paths": { @@ -2239,6 +2243,118 @@ } ] } + }, + "/status-page/{url}": { + "get": { + "tags": ["status-page"], + "description": "Get a status page by URL", + "parameters": [ + { + "name": "url", + "in": "path", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/SuccessResponse" } + } + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorResponse" } + } + } + } + } + }, + "post": { + "tags": ["status-page"], + "description": "Create a status page", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateStatusPageBody" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } + } + }, + "422": { + "description": "Unprocessable Content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "400": { + "description": "Duplicate URL", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "security": [ + { + "bearerAuth": [] + } + ] + } } }, "components": { @@ -2425,6 +2541,21 @@ "format": "date-time" } } + }, + "CreateStatusPageBody": { + "type": "object", + "required": ["companyName", "url", "timezone", "color", "theme", "monitors"], + "properties": { + "companyName": { "type": "string" }, + "url": { "type": "string" }, + "timezone": { "type": "string" }, + "color": { "type": "string" }, + "theme": { "type": "string" }, + "monitors": { + "type": "array", + "items": { "type": "string" } + } + } } } }