diff --git a/api.yaml b/api.yaml index 7f34af7..7b53be3 100644 --- a/api.yaml +++ b/api.yaml @@ -45,7 +45,7 @@ paths: - in: query name: limit schema: - type: integer + type: number description: Limit of recent authors to return responses: 200: @@ -70,7 +70,7 @@ paths: - in: query name: limit schema: - type: integer + type: number description: Limit of recent tags to return responses: 200: @@ -90,7 +90,7 @@ paths: - in: query name: limit schema: - type: integer + type: number description: Limit of recent articles to return responses: 200: @@ -134,7 +134,7 @@ paths: - in: query name: limit schema: - type: integer + type: number description: Limit of articles to return responses: 200: @@ -286,6 +286,110 @@ paths: 404: description: Article was not found + /api/assets: + get: + summary: Get a list of assets which a article uses + parameters: + - in: query + name: article_id + schema: + type: number + description: Id of the article to get the assets from + security: + - cookie: [] + responses: + 200: + description: All assets of the article + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Asset' + 401: + description: Not authorized + 404: + description: Article was not found + post: + summary: Adds a new asset to an article + requestBody: + content: + application/json: + 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 + content: + type: string + description: The asset itself + security: + - cookie: [] + responses: + 201: + description: The asset was created / uploaded + content: + application/json: + schema: + $ref: '#/components/schemas/Asset' + 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 + delete: + summary: Deletes assets + requestBody: + content: + application/json: + schema: + type: object + properties: + id: + type: number + description: Id of the assets to delete + security: + - cookie: [] + responses: + 200: + description: The asset was sucessfully deleted + 401: + description: Not authorized + 404: + description: An asset with this id does not exist + /api/tag: post: summary: Creates a new tag @@ -379,6 +483,18 @@ components: name: type: string description: Name of the tag + Asset: + type: object + properties: + id: + type: number + description: Id of the asset + name: + type: string + description: Name of the asset + link: + type: string + description: Static link to the asset securitySchemes: cookie: type: apiKey