mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 06:37:20 +02:00
feat(openapi): refactor into indiv. files to match API & tpl routing
This commit is contained in:
19
public/openapi/api/post/pid.yaml
Normal file
19
public/openapi/api/post/pid.yaml
Normal 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
|
||||
56
public/openapi/api/post/pid/id.yaml
Normal file
56
public/openapi/api/post/pid/id.yaml
Normal 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
|
||||
59
public/openapi/api/post/upload.yaml
Normal file
59
public/openapi/api/post/upload.yaml
Normal 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
|
||||
Reference in New Issue
Block a user