APIv2 Comment

This commit is contained in:
ruslan
2023-11-16 12:14:36 +02:00
parent c9cf6050b5
commit 36be4d2fa4
+156 -35
View File
@@ -1405,9 +1405,9 @@ paths:
400:
description: Bad Request. Returns a message with the error details.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Not found. Returns a message with the error details.
500:
@@ -1437,11 +1437,11 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Feedback not found.
description: Not found.
500:
description: Server Error.
@@ -1472,11 +1472,11 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Feedback not found.
description: Not found.
500:
description: Server Error.
@@ -1507,11 +1507,11 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Feedback not found.
description: Not found.
500:
description: Server Error.
@@ -1529,9 +1529,9 @@ paths:
schema:
$ref: '#/components/schemas/ideaStatuses'
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
500:
description: Server Error.
@@ -1549,9 +1549,9 @@ paths:
schema:
$ref: '#/components/schemas/ideaPurposes'
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
500:
description: Server Error.
@@ -1611,9 +1611,9 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Not found.
500:
@@ -1643,9 +1643,9 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Feedback not found.
500:
@@ -1681,9 +1681,9 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Feedback not found.
500:
@@ -1725,9 +1725,9 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Feedback not found.
500:
@@ -1769,9 +1769,9 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
404:
description: Feedback not found.
500:
@@ -1837,7 +1837,7 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
500:
description: Server Error.
@@ -1865,7 +1865,7 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
404:
description: Not found.
500:
@@ -1895,7 +1895,7 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
500:
description: Server Error.
@@ -1913,9 +1913,9 @@ paths:
schema:
$ref: '#/components/schemas/commentStatuses'
401:
description: Unauthorized request.
description: Unauthorized.
403:
description: Unauthorized request.
description: Unauthorized.
500:
description: Server Error.
@@ -1977,7 +1977,7 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
500:
description: Server Error.
@@ -2006,7 +2006,7 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
404:
description: Not found.
500:
@@ -2042,7 +2042,68 @@ paths:
400:
description: Bad Request.
401:
description: Unauthorized request.
description: Unauthorized.
404:
description: Not found.
500:
description: Server Error.
/comment/add:
post:
tags:
- comment
summary: Add a new comment. Access allowed with "Leave comments" (content-comments-post) role permission.
operationId: /comment/add
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/commentAddRequestBody'
responses:
200:
description: Text
content:
application/json:
schema:
$ref: '#/components/schemas/commentAddResponse'
400:
description: Bad Request.
401:
description: Unauthorized.
500:
description: Server Error.
/comment/delete:
delete:
tags:
- comment
summary: Comment safe delete (changes it's status to STATUS_DELETED). Access is allowed to the comment creator or users with the "Moderate comments" role permission (content-moderate-comments).
operationId: /comment/delete
parameters:
- name: id
in: query
description: Comment ID.
schema:
type: string
format: uuid
required: true
example: b726280a-2be6-4e62-ab24-1736389c6474
responses:
200:
description: Result as boolean value.
content:
application/json:
schema:
type: boolean
400:
description: Bad Request.
401:
description: Unauthorized.
403:
description: Forbidden.
404:
description: Not found.
500:
@@ -2119,7 +2180,7 @@ components:
type: integer
example: 1
name:
description: Status name.
description: Status name (localized).
type: string
example: Status name
@@ -4577,4 +4638,64 @@ components:
status:
$ref: '#/components/schemas/status'
createdUser:
$ref: '#/components/schemas/userInfo'
$ref: '#/components/schemas/userInfo'
commentAddRequestBody:
type: object
properties:
entity_id:
description: Entity ID.
required: true
type: number
example: 1
reference_id:
description: Reference ID.
required: true
type: string
format: uuid
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
reply_id:
description: Reply to comment ID.
type: string
format: uuid
default: null
message:
description: Comment text.
required: true
type: string
example: Test
maxLength: 2000
files:
description: Array of file IDs.
type: array
items:
type: string
example:
- '53f2d03c-303a-4a3c-b57f-f7fb62fee538'
- '42862a16-affa-4ba5-86c5-61376f46d695'
commentAddResponse:
type: object
properties:
success:
description: Result status.
type: boolean
example: true
message:
description: Message displayed to user (localized).
type: string
default: null
example: Comment added!
errors:
description: Array of validation errors.
type: array
default: null
data:
type: object
properties:
isApprovable:
description: If moderation is required, the value will be true.
type: boolean
example: false
comment:
$ref: '#/components/schemas/commentView'