From 963d8c31b3d417504bb4ef5f0dce358abbc115b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=BCnk=C3=B6sd=20Marcell?= Date: Wed, 25 Mar 2020 01:36:49 +0100 Subject: [PATCH] Did stuff bestesterest commit message evur - Added GET and DELETE endpoints - Added ERROR schema - Renamed Response to Success - Changed return types to object from list - Updated version - Updated descriptions --- storage.yml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 6 deletions(-) diff --git a/storage.yml b/storage.yml index ec427e4..a5c2d5c 100644 --- a/storage.yml +++ b/storage.yml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: Sound storage as object - version: 1.0.1 + version: 1.1.0 servers: - url: https://dev.k8s.tcloud.enginner/api/storage/v1 paths: @@ -24,20 +24,83 @@ paths: format: binary responses: '200': - description: Status message + description: Object successfully stored. This means that a get request for this object should be successful. content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Response' + $ref: '#/components/schemas/Success' + '409': + description: An object with this Tag already exists + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /object/{tag}: + get: + summary: Get a sound file from the storage + parameters: + - in: path + name: tag + schema: + type: string + required: true + description: Tag of the sound file to get + responses: + '200': + description: "The audio file requested" + content: + audio/wave: + schema: + type: string + format: binary + + '404': + description: "Unknown tag error" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + delete: + summary: Deletes a sound file from the storage + parameters: + - in: path + name: tag + schema: + type: string + required: true + description: Tag of the sound file to delete + responses: + '200': + description: "The audio file successfully deleted." + content: + application/json: + schema: + $ref: '#/components/schemas/Success' + + '404': + description: "Unknown tag error" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' components: schemas: - Response: + Success: properties: status: type: string description: "Status message from backend." + required: + - status + Error: + properties: + status: + type: string + description: "Status message from backend." + msg: + type: string + description: "Human-readable description of the error" required: - status \ No newline at end of file