swagger: upvote and downvote comment endpoints.

master
ALI Hamza 2020-09-10 21:04:19 +07:00
parent 0010525760
commit 9d4213829f
Signed by: hamza
GPG Key ID: 22473A32291F8CB6
1 changed files with 58 additions and 3 deletions

@ -323,7 +323,7 @@ paths:
/comments/new: /comments/new:
post: post:
tags: tags:
- Comment Endpoints. - Comment Endpoints
security: security:
- token: [ ] - token: [ ]
summary: Submit a comment. summary: Submit a comment.
@ -350,7 +350,7 @@ paths:
post_id: a1b2c3d4 post_id: a1b2c3d4
responses: responses:
200: 200:
description: The created post ID description: The created comment ID
content: content:
application/json: application/json:
schema: schema:
@ -366,7 +366,62 @@ paths:
$ref: '#/components/responses/Unprocessable' $ref: '#/components/responses/Unprocessable'
500: 500:
$ref: '#/components/responses/ServerError' $ref: '#/components/responses/ServerError'
/comment/{id}/upvote:
post:
tags:
- Comment Endpoints
summary: Upvote a comment.
description: Add an upvote to a specified comment. If you have already upvoted a point, it is retracted.
security:
- token: []
parameters:
- name: id
in: path
required: true
description: The comment ID to upvote.
schema:
type: string
responses:
200:
description: Your upvote has successfully been registered.
content:
application/json:
schema:
type: object
401:
$ref: '#/components/responses/InvalidToken'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/ServerError'
/comment/{id}/downvote:
post:
tags:
- Comment Endpoints
summary: Downvote a comment
description: Add an downvote to a specified comment. If you have already downvoted a point, it is retracted.
security:
- token: []
parameters:
- name: id
in: path
required: true
description: The comment ID to downvote.
schema:
type: string
responses:
200:
description: Your downvote has successfully been registered.
content:
application/json:
schema:
type: object
401:
$ref: '#/components/responses/InvalidToken'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/ServerError'
components: components:
parameters: parameters:
AfterParam: AfterParam: