feat(openapi): refactor into indiv. files to match API & tpl routing

This commit is contained in:
psychobunny
2020-09-29 15:17:09 -04:00
parent c7d27731b3
commit ffbf2d6d63
125 changed files with 8339 additions and 8224 deletions

View File

@@ -0,0 +1,19 @@
get:
tags:
- shorthand
summary: Access a specific post
description: This route comes in handy when all you have is the `pid`, and you want to redirect users to the canonical URL for the topic, with the appropriate topic slug and post index.
parameters:
- name: pid
in: path
required: true
schema:
type: string
example: 1
responses:
"200":
description: "Canonical URL of topic"
content:
text/plain:
schema:
type: string

View File

@@ -0,0 +1,56 @@
get:
tags:
- shorthand
summary: Get post data
parameters:
- name: id
in: path
required: true
schema:
type: number
example: 1
responses:
"200":
description: "A JSON object containing post data"
content:
application/json:
schema:
type: object
properties:
uid:
type: number
tid:
type: number
timestamp:
type: number
content:
type: string
pid:
type: number
downvotes:
type: number
upvotes:
type: number
bookmarks:
type: number
deleted:
type: number
deleterUid:
type: number
edited:
type: number
votes:
type: number
timestampISO:
type: string
editedISO:
type: string
upvoted:
type: boolean
downvoted:
type: boolean
flagId:
type: number
description: The flag identifier, if this particular post has been flagged before
replies:
type: number

View File

@@ -0,0 +1,59 @@
post:
tags:
- posts
summary: Upload a file to a specific post
description: Provided by NodeBB core and used mainly by the composer, this route allows you to upload an image or file to a post.
responses:
"200":
description: ""
content:
application/json:
schema:
type: array
items:
type: object
properties:
name:
type: string
url:
type: string
text/plain:
schema:
type: array
items:
type: object
properties:
name:
type: string
url:
type: string
"403":
description: ""
content:
application/json:
schema:
type: string
example: Forbidden
text/plain:
schema:
type: string
example: Forbidden
"500":
description: ""
content:
application/json:
schema:
type: object
properties:
path:
type: string
error:
type: string
text/plain:
schema:
type: object
properties:
path:
type: string
error:
type: string