From 07b9d7eb5698e7410e74180f2f8fa0c8197f009a Mon Sep 17 00:00:00 2001 From: panaaj <38519157+panaaj@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:11:03 +1030 Subject: [PATCH] Add put / post chart definitions --- src/api/resources/openApi.json | 112 ++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/src/api/resources/openApi.json b/src/api/resources/openApi.json index e0f69ed49..bdbde6965 100644 --- a/src/api/resources/openApi.json +++ b/src/api/resources/openApi.json @@ -19,6 +19,10 @@ } ], "tags": [ + { + "name": "providers", + "description": "Resource Providers" + }, { "name": "resources", "description": "Signal K resources" @@ -210,6 +214,12 @@ } } }, + "Providers": { + "type": "array", + "items": { + "type": "string" + } + }, "Route": { "type": "object", "description": "Signal K Route resource", @@ -475,7 +485,7 @@ "type": { "type": "string", "description": "Source type of map data.", - "enum": ["tilejson", "wms", "wmts"], + "enum": ["tilejson", "wms", "wmts", "s-57"], "default": "wms", "example": "wms" } @@ -1399,6 +1409,29 @@ } } } + }, + "post": { + "tags": ["charts"], + "summary": "New Chart", + "requestBody": { + "description": "Chart resource entry", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Chart" + } + } + } + }, + "responses": { + "201": { + "$ref": "#/components/responses/201ActionResponse" + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } } }, "/resources/charts/{id}": { @@ -1451,6 +1484,83 @@ } } } + }, + "/resources/providers": { + "get": { + "tags": ["providers"], + "summary": "List of registered resource providers", + "responses": { + "default": { + "description": "An object containing registered resource providers, keyed by resource types.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "allOf": [ + { + "$ref": "#/components/schemas/Providers" + } + ] + } + } + } + } + } + } + } + }, + "/resources/providers/default/{resourceType}": { + "post": { + "tags": ["providers"], + "summary": "Set the default provider for a resource type.", + "requestBody": { + "description": "Set the default provider to handle PUT / POST requests for a resource type.", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["value"], + "properties": { + "value": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "PUT, DELETE OK response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "state": { + "type": "string", + "enum": ["COMPLETED"] + }, + "statusCode": { + "type": "number", + "enum": [200] + }, + "message": { + "type": "string" + } + }, + "required": ["statusCode", "state"] + } + } + } + }, + "default": { + "$ref": "#/components/responses/ErrorResponse" + } + } + } } } }