From 60dccb5e69a66eb904c99a0a430d0b795ad30185 Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 24 Jan 2022 11:36:10 +0100 Subject: [PATCH] Optimized assets endpoint --- api.yaml | 44 +++++--------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) diff --git a/api.yaml b/api.yaml index c78c76f..a36da78 100644 --- a/api.yaml +++ b/api.yaml @@ -288,13 +288,13 @@ paths: /api/assets: get: - summary: Get a list of assets which a article uses + summary: Get a list of assets parameters: - in: query - name: article_id + name: q schema: - type: number - description: Id of the article to get the assets from + type: string + description: Name of assets to search security: - cookie: [] responses: @@ -308,8 +308,6 @@ paths: $ref: '#/components/schemas/Asset' 401: description: Not authorized - 404: - description: Article was not found post: summary: Adds a new asset to an article requestBody: @@ -318,9 +316,6 @@ paths: schema: type: object properties: - article_id: - type: number - description: Id of the article to store the asset to name: type: string description: Name of the asset @@ -339,36 +334,7 @@ paths: 401: description: Not authorized 409: - description: A asset with the same name for the same article already exists - patch: - summary: Changes an asset name. This impacts its alt tag and the link to it - requestBody: - content: - application/json: - schema: - type: object - properties: - id: - type: number - description: Id of the asset - name: - type: string - description: New name of the asset - security: - - cookie: [] - responses: - 200: - description: The asset name was changed successfully - content: - application/json: - schema: - $ref: '#/components/schemas/Asset' - 401: - description: Not authorized - 404: - description: An asset with this id does not exist - 409: - description: A asset with the same name for the same article already exists + description: A asset with the same name already exists delete: summary: Deletes assets requestBody: