From 39752b04cef2dd8078e8ca2dccfada1e6fa25fc0 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:09:07 +0100 Subject: [PATCH] added postman api integration --- .postman/api | 4 + .../api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 | 20 +++ index.json | 119 ++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 .postman/api create mode 100644 .postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 create mode 100644 index.json diff --git a/.postman/api b/.postman/api new file mode 100644 index 0000000..a1d7485 --- /dev/null +++ b/.postman/api @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY +apis[] = {"apiId":"73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2"} +configVersion = 1.0.0 +type = api diff --git a/.postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 b/.postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 new file mode 100644 index 0000000..2a62c81 --- /dev/null +++ b/.postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 @@ -0,0 +1,20 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY +configVersion = 1.1.0 +type = apiEntityData + +[config] +id = 73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 + +[config.relations] + +[config.relations.collections] +rootDirectory = postman/collections + +[config.relations.collections.metaData] + +[config.relations.apiDefinition] +files[] = {"path":"index.json","metaData":{}} + +[config.relations.apiDefinition.metaData] +type = openapi:3 +rootFiles[] = index.json diff --git a/index.json b/index.json new file mode 100644 index 0000000..771180c --- /dev/null +++ b/index.json @@ -0,0 +1,119 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API", + "description": "Buy or rent spacecrafts" + }, + "paths": { + "/spacecrafts/{spacecraftId}": { + "parameters": [ + { + "name": "spacecraftId", + "description": "The unique identifier of the spacecraft", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/SpacecraftId" + } + } + ], + "get": { + "summary": "Read a spacecraft", + "responses": { + "200": { + "description": "The spacecraft corresponding to the provided `spacecraftId`", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Spacecraft" + } + } + } + }, + "404": { + "description": "No spacecraft found for the provided `spacecraftId`", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "500": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SpacecraftId": { + "description": "The unique identifier of a spacecraft", + "type": "string" + }, + "Spacecraft": { + "type": "object", + "required": [ + "id", + "name", + "type" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/SpacecraftId" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "capsule", + "probe", + "satellite", + "spaceplane", + "station" + ] + }, + "description": { + "type": "string" + } + } + }, + "Error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "A human readable error message", + "type": "string" + } + } + } + }, + "securitySchemes": { + "ApiKey": { + "type": "apiKey", + "in": "header", + "name": "X-Api-Key" + } + } + }, + "security": [ + { + "ApiKey": [] + } + ] +} \ No newline at end of file