From 7144b017b3a684c476a921175c43d0a75edcd290 Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Sat, 27 Jul 2024 17:05:00 +0200 Subject: [PATCH] Docs --- exam/api/docs/api.yaml | 19 +++++++++++++++++-- exam/api/docs/index.html | 10 +++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/exam/api/docs/api.yaml b/exam/api/docs/api.yaml index 24bb288..50cc4e5 100644 --- a/exam/api/docs/api.yaml +++ b/exam/api/docs/api.yaml @@ -182,6 +182,15 @@ paths: application/json: schema: $ref: "#/components/schemas/PostCreateRequest" + parameters: + - in: query + name: l + schema: + type: integer + minimum: 0 + maximum: 30 + default: 10 + description: The number of items to return. responses: 200: description: Success. @@ -275,6 +284,14 @@ paths: schema: type: integer format: int14 + - in: query + name: l + schema: + type: integer + minimum: 0 + maximum: 30 + default: 10 + description: The number of items to return. responses: 200: description: Success. @@ -720,8 +737,6 @@ components: properties: content: type: string - limit: - type: number securitySchemes: BasicAuth: type: apiKey diff --git a/exam/api/docs/index.html b/exam/api/docs/index.html index fa1b593..5aaccfc 100644 --- a/exam/api/docs/index.html +++ b/exam/api/docs/index.html @@ -430,11 +430,13 @@ data-styled.g137[id="sc-kvXgyf"]{content:"fBvPoH,"}/*!sc*/ " class="sc-euGpHm sc-exayXG fwfkcU kqJXdD sc-dHrNzZ dRdjww">

Success.

Response samples

Content type
application/json
Example
{
  • "pages": 0,
  • "data": [
    ]
}

New post

Create a new post.

-
Authorizations:
BasicAuth
Request Body schema: application/json
required
content
required
string
limit
number

Responses

Request samples

Content type
application/json
{
  • "content": "string",
  • "limit": 0
}

Response samples

Content type
application/json
{
  • "pages": 0,
  • "post": {
    }
}

Update post

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "pages": 0,
  • "post": {
    }
}

Update post

Update post with ID.
Requires logged in user to have admin permissions for posts not made by them.

Authorizations:
BasicAuthBasicAuth
path Parameters
id
required
integer <int14>

Post ID

@@ -450,6 +452,8 @@ data-styled.g137[id="sc-kvXgyf"]{content:"fBvPoH,"}/*!sc*/ " class="sc-euGpHm sc-exayXG fwfkcU kqJXdD">

Delete post with ID.

Authorizations:
BasicAuth
path Parameters
id
required
integer <int14>

Post ID

+
query Parameters
l
integer [ 0 .. 30 ]
Default: 10

The number of items to return.

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "status": 0,
  • "email": "string",
  • "image": "string",
  • "isAdmin": true,
  • "memberSince": {
    },
  • "postCount": 0
}