docs(socket.io): added schema for new routes

This commit is contained in:
Julian Lam
2023-10-24 13:54:19 -04:00
parent 010727f5cb
commit f279bca038
4 changed files with 82 additions and 0 deletions

View File

@@ -112,6 +112,10 @@ paths:
$ref: 'write/categories.yaml'
/categories/{cid}:
$ref: 'write/categories/cid.yaml'
/categories/{cid}/count:
$ref: 'write/categories/cid/count.yaml'
/categories/{cid}/posts:
$ref: 'write/categories/cid/posts.yaml'
/categories/{cid}/privileges:
$ref: 'write/categories/cid/privileges.yaml'
/categories/{cid}/privileges/{privilege}:

View File

@@ -1,3 +1,25 @@
get:
tags:
- categories
summary: list categories
description: This operation returns a flat list of categories available to the calling user
responses:
'200':
description: categories successfully listed
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../components/schemas/Status.yaml#/Status
response:
type: object
properties:
categories:
type: array
items:
$ref: ../components/schemas/CategoryObject.yaml#/CategoryObject
post:
tags:
- categories

View File

@@ -0,0 +1,28 @@
get:
tags:
- categories
summary: get topic count
description: This operation returns the count of topics in a given category (excluding its subcategories)
parameters:
- in: path
name: cid
schema:
type: string
required: true
description: a valid category id, `0` for global privileges, `admin` for admin privileges
example: 1
responses:
'200':
description: categories count successfully retrieved
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../../components/schemas/Status.yaml#/Status
response:
type: object
properties:
count:
type: number

View File

@@ -0,0 +1,28 @@
get:
tags:
- categories
summary: get topic posts
description: This operation returns a list of posts in the category, across all topics in that category (excluding its subcategories)
parameters:
- in: path
name: cid
schema:
type: string
required: true
description: a valid category id, `0` for global privileges, `admin` for admin privileges
example: 1
responses:
'200':
description: categories posts successfully retrieved
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../../components/schemas/Status.yaml#/Status
response:
type: object
properties:
posts:
$ref: ../../../components/schemas/PostsObject.yaml#/PostsObject