feature #11: describe "get/edit comment" in openAPI

This commit is contained in:
2019-08-29 22:58:49 +02:00
parent 00dbcaf7ab
commit 639b839058

View File

@@ -215,6 +215,37 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ConstitutionResponse' $ref: '#/components/schemas/ConstitutionResponse'
/comments/{comment}:
get:
summary: Get Comment and children by Comment ID
tags:
- comment
responses:
200:
description: Return Comment and children
content:
application/json:
schema:
$ref: '#/components/schemas/CommentResponse'
put:
security:
- JWTAuth: []
summary: Edit existing comment
tags:
- comment
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CommentRequest'
responses:
200:
description: Return Comment and children
content:
application/json:
schema:
$ref: '#/components/schemas/CommentResponse'
components: components:
parameters: parameters:
@@ -296,6 +327,11 @@ components:
created_at: created_at:
type: string type: string
format: 'date-time' format: 'date-time'
UpdatedAt:
properties:
updated_at:
type: string
format: 'date-time'
versionId: versionId:
properties: properties:
@@ -503,6 +539,40 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/ArticleResponse' $ref: '#/components/schemas/ArticleResponse'
CommentBase:
type: object
allOf:
- type: object
properties:
content:
type: string
required: true
example:
Lorem ipsum...
CommentRequest:
allOf:
- $ref: '#/components/schemas/CommentBase'
CommentResponse:
allOf:
- $ref: '#/components/schemas/CommentBase'
- $ref: '#/components/schemas/CreatedBy'
- $ref: '#/components/schemas/CreatedAt'
- $ref: '#/components/schemas/UpdatedAt'
- type: object
properties:
parents_ids:
type: array
required: false
items:
$ref: '#/components/schemas/UUID'
target:
$ref: '#/components/schemas/UuidEntity'
parent:
required: false
allOf:
- $ref: '#/components/schemas/UUID'
- $ref: '#/components/schemas/UUID'