style(openapi): break write API routes into individual files

This commit is contained in:
psychobunny
2020-10-09 11:07:25 -04:00
committed by Andrew Rodrigues
parent ffac3c7902
commit dbb4cfe9d6
144 changed files with 1177 additions and 1160 deletions

View 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: {}

View 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: {}

View 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: {}

View 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: {}