From ab8b53d2cf248343aa63c48b196157b1a2fcd6b0 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Sat, 8 May 2021 19:46:05 -0400 Subject: [PATCH] Add API endpoint to docs for image config aliases Remove post/delete options from main image endpoint docs --- openapi.yaml | 92 ++++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 54 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 0d93663..f184fad 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -58,60 +58,6 @@ paths: $ref: "#/components/responses/DeletedError" '500': $ref: "#/components/responses/InternalServerError" - post: - summary: Upload an image to the server - operationId: ImageUpload - tags: ["image"] - parameters: - - $ref: "#/components/parameters/ImageName" - - $ref: "#/components/parameters/ImageFormat" - responses: - '201': - description: Image uploaded successfully - '405': - $ref: "#/components/responses/MethodNotAllowedError" - '406': - description: Image is not acceptable for upload - headers: *headers-default - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - '409': - description: Image with provided ID already exists - headers: *headers-default - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - '413': - description: Image is too large for upload - headers: *headers-default - content: - application/json: - schema: - $ref: "#/components/schemas/Error" - '500': - $ref: "#/components/responses/InternalServerError" - delete: - summary: Delete an image from the server - operationId: ImageDelete - tags: ["image", "manipulate"] - parameters: - - $ref: "#/components/parameters/ImageName" - - $ref: "#/components/parameters/ImageFormat" - responses: - '204': - description: Image with provided ID successfully deleted - headers: *headers-default - '404': - $ref: "#/components/responses/NotFoundError" - '405': - $ref: "#/components/responses/MethodNotAllowedError" - '410': - $ref: "#/components/responses/DeletedError" - '500': - $ref: "#/components/responses/InternalServerError" options: summary: Retrieve available HTTP verbs for the selected endpoint operationId: ImageOptions @@ -188,6 +134,37 @@ paths: - $ref: "#/components/parameters/ImageCropWidth" - $ref: "#/components/parameters/ImageCropHeight" responses: *responses-options + /image/{image_name}/{alias}.{format}: + get: + summary: Fetch a pre configured version of the image + operationId: ImageAlias + tags: ["manipulate"] + parameters: + - $ref: "#/components/parameters/ImageName" + - $ref: "#/components/parameters/ImageFormat" + - $ref: "#/components/parameters/ImageAlias" + responses: + '200': + description: Scaled thumbnail image of specified dimentions + headers: *headers-default + content: + image/jpeg: {} + image/png: {} + '404': + $ref: "#/components/responses/NotFoundError" + '410': + $ref: "#/components/responses/DeletedError" + '500': + $ref: "#/components/responses/InternalServerError" + options: + summary: Retrieve available HTTP verbs for the selected endpoint + operationId: ImageAliasOptions + tags: ["meta"] + parameters: + - $ref: "#/components/parameters/ImageName" + - $ref: "#/components/parameters/ImageFormat" + - $ref: "#/components/parameters/ImageAlias" + responses: *responses-options components: schemas: Error: @@ -269,6 +246,13 @@ components: schema: type: number format: integer + ImageAlias: + name: alias + in: path + description: Name of the image config alias to use + required: true + schema: + type: string responses: InternalServerError: description: Internal server error