mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
docs(socket.io): added schema for new routes
This commit is contained in:
@@ -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}:
|
||||
|
||||
@@ -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
|
||||
|
||||
28
public/openapi/write/categories/cid/count.yaml
Normal file
28
public/openapi/write/categories/cid/count.yaml
Normal 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
|
||||
28
public/openapi/write/categories/cid/posts.yaml
Normal file
28
public/openapi/write/categories/cid/posts.yaml
Normal 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
|
||||
Reference in New Issue
Block a user