From 639b83905861c761c66c8cf1dc3014d878e6a856 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Thu, 29 Aug 2019 22:58:49 +0200 Subject: [PATCH] feature #11: describe "get/edit comment" in openAPI --- src/main/resources/openApi.yaml | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/main/resources/openApi.yaml b/src/main/resources/openApi.yaml index dc81910..6cf7941 100644 --- a/src/main/resources/openApi.yaml +++ b/src/main/resources/openApi.yaml @@ -215,6 +215,37 @@ paths: application/json: schema: $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: parameters: @@ -296,6 +327,11 @@ components: created_at: type: string format: 'date-time' + UpdatedAt: + properties: + updated_at: + type: string + format: 'date-time' versionId: properties: @@ -503,6 +539,40 @@ components: type: array items: $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'