From 77269a82e62025b915e939b93b59ae1be03497cc Mon Sep 17 00:00:00 2001 From: Jan Friedli Date: Mon, 13 Jul 2020 08:21:08 +0200 Subject: [PATCH] documented extension endpoint --- matweb/oas/download.yml | 6 ++---- matweb/oas/extension.yml | 17 +++++++++++++++++ matweb/rest_api.py | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 matweb/oas/extension.yml diff --git a/matweb/oas/download.yml b/matweb/oas/download.yml index 4c101a4..899d103 100644 --- a/matweb/oas/download.yml +++ b/matweb/oas/download.yml @@ -26,8 +26,6 @@ parameters: responses: 200: - description: "An object containing all info about the cleaned file" - schema: - $ref: '#/definitions/UploadResponse' + description: "" 404: - description: "The filename, key or secret are wrong" \ No newline at end of file + description: "The filename, key or secret are wrong or the link is too old and the file has been deleted" \ No newline at end of file diff --git a/matweb/oas/extension.yml b/matweb/oas/extension.yml new file mode 100644 index 0000000..3e31034 --- /dev/null +++ b/matweb/oas/extension.yml @@ -0,0 +1,17 @@ +--- +tags: + - "Supported Extensions" +summary: 'Returns a list of all supported file extensions' +consumes: + - "application/json" +produces: + - "application/json" + +responses: + 200: + description: "A list of all supported file extensions" + schema: + type: "array" + items: + type: "string" + example: ".jpeg" \ No newline at end of file diff --git a/matweb/rest_api.py b/matweb/rest_api.py index 20ec155..0e47a5d 100644 --- a/matweb/rest_api.py +++ b/matweb/rest_api.py @@ -160,5 +160,6 @@ class APIBulkDownloadCreator(Resource): class APISupportedExtensions(Resource): + @swag_from('./oas/extension.yml') def get(self): return utils.get_supported_extensions()