mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
docs: openapi schema for newly added routes
This commit is contained in:
@@ -144,6 +144,10 @@ paths:
|
|||||||
$ref: 'write/topics/tid/events/eventId.yaml'
|
$ref: 'write/topics/tid/events/eventId.yaml'
|
||||||
/posts/{pid}:
|
/posts/{pid}:
|
||||||
$ref: 'write/posts/pid.yaml'
|
$ref: 'write/posts/pid.yaml'
|
||||||
|
/posts/{pid}/raw:
|
||||||
|
$ref: 'write/posts/pid/raw.yaml'
|
||||||
|
/posts/{pid}/summary:
|
||||||
|
$ref: 'write/posts/pid/summary.yaml'
|
||||||
/posts/{pid}/state:
|
/posts/{pid}/state:
|
||||||
$ref: 'write/posts/pid/state.yaml'
|
$ref: 'write/posts/pid/state.yaml'
|
||||||
/posts/{pid}/move:
|
/posts/{pid}/move:
|
||||||
|
|||||||
28
public/openapi/write/posts/pid/raw.yaml
Normal file
28
public/openapi/write/posts/pid/raw.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- posts
|
||||||
|
summary: get post's raw content
|
||||||
|
description: This operation retrieves a post's raw content (unparsed by markdown, etc.)
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: pid
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: a valid post id
|
||||||
|
example: 2
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Post raw content successfully retrieved.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||||
|
response:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
content:
|
||||||
|
type: string
|
||||||
70
public/openapi/write/posts/pid/summary.yaml
Normal file
70
public/openapi/write/posts/pid/summary.yaml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- posts
|
||||||
|
summary: get post summary
|
||||||
|
description: |
|
||||||
|
This operation retrieves a post full summary.
|
||||||
|
|
||||||
|
This differs from the "get a post" call in that it will return the following additional information:
|
||||||
|
|
||||||
|
* A minimal user object
|
||||||
|
* A topic object
|
||||||
|
* A category object
|
||||||
|
* Post content is run through the parser
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: pid
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
description: a valid post id
|
||||||
|
example: 2
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Post summary successfully retrieved.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
status:
|
||||||
|
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||||
|
response:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
pid:
|
||||||
|
type: number
|
||||||
|
tid:
|
||||||
|
type: number
|
||||||
|
description: A topic identifier
|
||||||
|
content:
|
||||||
|
type: string
|
||||||
|
uid:
|
||||||
|
type: number
|
||||||
|
description: A user identifier
|
||||||
|
timestamp:
|
||||||
|
type: number
|
||||||
|
deleted:
|
||||||
|
type: number
|
||||||
|
upvotes:
|
||||||
|
type: number
|
||||||
|
downvotes:
|
||||||
|
type: number
|
||||||
|
replies:
|
||||||
|
type: number
|
||||||
|
votes:
|
||||||
|
type: number
|
||||||
|
timestampISO:
|
||||||
|
type: string
|
||||||
|
user:
|
||||||
|
type: object
|
||||||
|
additionalProperties: {}
|
||||||
|
topic:
|
||||||
|
type: object
|
||||||
|
additionalProperties: {}
|
||||||
|
category:
|
||||||
|
type: object
|
||||||
|
additionalProperties: {}
|
||||||
|
isMainPost:
|
||||||
|
type: boolean
|
||||||
Reference in New Issue
Block a user