mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-08-02 03:39:27 +02:00
style(openapi): break write API routes into individual files
This commit is contained in:
committed by
Andrew Rodrigues
parent
ffac3c7902
commit
dbb4cfe9d6
53
public/openapi/write/posts/pid.yaml
Normal file
53
public/openapi/write/posts/pid.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
put:
|
||||
tags:
|
||||
- posts
|
||||
summary: edit a post
|
||||
description: This operation edits a post
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
content:
|
||||
type: string
|
||||
description: New post content
|
||||
title:
|
||||
type: string
|
||||
description: Topic title, only accepted for main posts
|
||||
required:
|
||||
- content
|
||||
example:
|
||||
content: 'New post content'
|
||||
title: 'New title'
|
||||
responses:
|
||||
'200':
|
||||
description: Post successfully edited
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
$ref: ../../components/schemas/PostsObject.yaml#/PostsObject
|
||||
delete:
|
||||
tags:
|
||||
- posts
|
||||
summary: purge a post
|
||||
description: This operation purges a post.
|
||||
responses:
|
||||
'200':
|
||||
description: Post successfully purged
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties: {}
|
||||
36
public/openapi/write/posts/pid/bookmark.yaml
Normal file
36
public/openapi/write/posts/pid/bookmark.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
put:
|
||||
tags:
|
||||
- posts
|
||||
summary: bookmark a post
|
||||
description: This operation bookmarks a post.
|
||||
responses:
|
||||
'200':
|
||||
description: Post successfully bookmarked
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties: {}
|
||||
delete:
|
||||
tags:
|
||||
- posts
|
||||
summary: unbookmark a post
|
||||
description: This operation unbookmarks a post.
|
||||
responses:
|
||||
'200':
|
||||
description: Post successfully unbookmarked
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties: {}
|
||||
36
public/openapi/write/posts/pid/state.yaml
Normal file
36
public/openapi/write/posts/pid/state.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
put:
|
||||
tags:
|
||||
- posts
|
||||
summary: restore a post
|
||||
description: This operation restores a post.
|
||||
responses:
|
||||
'200':
|
||||
description: Topic successfully restored
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties: {}
|
||||
delete:
|
||||
tags:
|
||||
- posts
|
||||
summary: deletes a post
|
||||
description: This operation soft deletes a post.
|
||||
responses:
|
||||
'200':
|
||||
description: Post successfully deleted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties: {}
|
||||
48
public/openapi/write/posts/pid/vote.yaml
Normal file
48
public/openapi/write/posts/pid/vote.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
put:
|
||||
tags:
|
||||
- posts
|
||||
summary: vote on a post
|
||||
description: This operation casts a vote on a post.
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
delta:
|
||||
type: number
|
||||
description: Positive integer for upvote, negative integer for downvote (0 to unvote.)
|
||||
example:
|
||||
delta: 1
|
||||
responses:
|
||||
'200':
|
||||
description: Post successfully upvoted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties: {}
|
||||
delete:
|
||||
tags:
|
||||
- posts
|
||||
summary: unvote a post
|
||||
description: This operation removes a pre-cast vote on a post.
|
||||
responses:
|
||||
'200':
|
||||
description: Post successfully unvoted
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties: {}
|
||||
Reference in New Issue
Block a user