docs: openapi schema for newly added routes

isekai-main
Julian Lam 2 years ago
parent f2082d7de8
commit 02f567ff3f

@ -144,6 +144,10 @@ paths:
$ref: 'write/topics/tid/events/eventId.yaml'
/posts/{pid}:
$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:
$ref: 'write/posts/pid/state.yaml'
/posts/{pid}/move:

@ -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

@ -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
Loading…
Cancel
Save