Added api create endpoint

This commit is contained in:
2022-01-21 23:29:49 +01:00
parent 880e33ed20
commit 8e6084acf8

View File

@@ -226,7 +226,7 @@ paths:
properties: properties:
id: id:
type: number type: number
description: ID of the article to delete description: Id of the article to delete
security: security:
- cookie: [] - cookie: []
responses: responses:
@@ -243,6 +243,35 @@ paths:
schema: schema:
$ref: '#/components/schemas/ApiError' $ref: '#/components/schemas/ApiError'
/api/tag:
post:
summary: Creates a new tag
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Name of the new tag
security:
- cookie: []
responses:
201:
description: The tag was created
content:
application/json:
schema:
$ref: '#/components/schemas/Tag'
401:
description: Not authorized
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
components: components:
schemas: schemas:
ApiError: ApiError:
@@ -294,7 +323,10 @@ components:
type: string type: string
description: A short overview summary of the article description: A short overview summary of the article
author: author:
$ref: '#/components/schemas/Author' type: array
items:
type: number
description: Id of authors to add
image: image:
type: string type: string
description: Link to a preview image description: Link to a preview image
@@ -302,7 +334,8 @@ components:
tags: tags:
type: array type: array
items: items:
$ref: '#/components/schemas/Tag' type: number
description: Id of tags to add
created: created:
type: string type: string
description: A RFC3339 formatted date when the article was created description: A RFC3339 formatted date when the article was created