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:
id:
type: number
description: ID of the article to delete
description: Id of the article to delete
security:
- cookie: []
responses:
@@ -242,6 +242,35 @@ paths:
application/json:
schema:
$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:
schemas:
@@ -294,7 +323,10 @@ components:
type: string
description: A short overview summary of the article
author:
$ref: '#/components/schemas/Author'
type: array
items:
type: number
description: Id of authors to add
image:
type: string
description: Link to a preview image
@@ -302,7 +334,8 @@ components:
tags:
type: array
items:
$ref: '#/components/schemas/Tag'
type: number
description: Id of tags to add
created:
type: string
description: A RFC3339 formatted date when the article was created