openapi: 3.0.3 info: version: v1.0.3 title: LE-KO Feed Comments license: name: private url: https:/le-ko.deggex.com contact: email: denis@deggex.awsapps.com description: LE-KO Feed Comments servers: - url: https://booking-{env}.le-ko.deggex.com/{basePath} description: Feed Comments endpoint variables: basePath: default: v1 env: default: dev security: - bearerHttpAuthentication: [] tags: - name: comments description: Feed Comments paths: /feeds/{userId}/posts/{postId}/comments: get: summary: .../comments operationId: getAllComments description: ✨ Comments of specific Post. tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/PostId' - $ref: '#/components/parameters/ParamPage' - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/TraceparentHeader' responses: '200': description: Post Photos content: application/json: schema: $ref: '#/components/schemas/CommentsPage' '400': $ref: '#/components/responses/400' post: summary: .../comments operationId: createComment description: ✨ Create new Post Comment. tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/PostId' - $ref: '#/components/parameters/TraceparentHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateComment' responses: '200': description: Post Comment has been created content: application/json: schema: $ref: '#/components/schemas/Comment' '400': $ref: '#/components/responses/400' /feeds/{userId}/posts/{postId}/comments/{commentId}: get: summary: .../comments/{id} operationId: getCommentById description: ✨ Get Post Comment. tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/PostId' - $ref: '#/components/parameters/CommentId' - $ref: '#/components/parameters/TraceparentHeader' responses: '200': description: Post Comment details content: application/json: schema: $ref: '#/components/schemas/Comment' '400': $ref: '#/components/responses/400' put: summary: .../comments/{id} operationId: updateComment description: ✨ Update Post Comment tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/PostId' - $ref: '#/components/parameters/CommentId' - $ref: '#/components/parameters/TraceparentHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateComment' responses: '200': description: Post Comment has been deleted content: application/json: schema: $ref: '#/components/schemas/Comment' '400': $ref: '#/components/responses/400' '403': $ref: '#/components/responses/403' delete: summary: .../comments/{id} operationId: deleteComment description: ✨ Delete Post Comment. tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/PostId' - $ref: '#/components/parameters/CommentId' - $ref: '#/components/parameters/TraceparentHeader' responses: '200': description: Post Comment has been deleted content: application/json: schema: type: object properties: commentId: $ref: '#/components/schemas/CommentId' '400': $ref: '#/components/responses/400' '403': $ref: '#/components/responses/403' /feeds/{userId}/posts/{postId}/comments/{commentId}/likes: get: summary: .../comments/{id}/likes operationId: getAllCommentLikes description: ✨ Get Comment Likes tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/PostId' - $ref: '#/components/parameters/CommentId' - $ref: '#/components/parameters/ParamPage' - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/TraceparentHeader' responses: '200': description: Comment Likes content: application/json: schema: $ref: '#/components/schemas/LikesPage' '400': $ref: '#/components/responses/400' /feeds/{userId}/posts/{postId}/comments/{commentId}/like: put: summary: .../comments/{id}/like operationId: toggleCommentLike description: ✨ Comment like toggling tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/PostId' - $ref: '#/components/parameters/CommentId' - $ref: '#/components/parameters/TraceparentHeader' responses: '200': description: Comment Like has been changed content: application/json: schema: $ref: '#/components/schemas/Like' '400': $ref: '#/components/responses/400' '403': $ref: '#/components/responses/403' /feeds/posts/comments/{commentId}/reports: post: operationId: createCommentReport summary: Report a comment description: ✨ Submit a report for inappropriate or problematic comment content tags: - comments parameters: - $ref: '#/components/parameters/CurrentUserId' - $ref: '#/components/parameters/CommentId' - $ref: '#/components/parameters/TraceparentHeader' requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateReportRequest' responses: '201': description: Report created successfully '400': $ref: '#/components/responses/400' '404': $ref: '#/components/responses/404' components: securitySchemes: bearerHttpAuthentication: description: Bearer token using a JWT type: http scheme: bearer bearerFormat: JWT schemas: UserId: type: string example: 00000000-0000-1000-9000-55f01dda9dd0 description: User ID format: uuid PostId: type: string example: 00000000-0000-1000-9000-510d9bb07630 description: Post ID format: uuid PageNumber: type: integer description: Page number example: 0 minimum: 0 default: 0 PageLimit: type: integer description: Page limit default: 10 minimum: 1 maximum: 100 example: 10 Count: type: integer description: Page entries count example: 10 CurrentPage: type: integer deprecated: true description: Current page example: 0 minimum: 0 default: 0 PageSize: type: integer deprecated: true description: Page size default: 10 minimum: 1 maximum: 100 example: 10 TotalCount: type: integer description: Total count default: 0 minimum: 0 example: 1000 Page: type: object required: - count - page - limit - total properties: data: type: array items: type: object count: $ref: '#/components/schemas/Count' currentPage: $ref: '#/components/schemas/CurrentPage' page: $ref: '#/components/schemas/PageNumber' pageSize: $ref: '#/components/schemas/PageSize' limit: $ref: '#/components/schemas/PageLimit' total: $ref: '#/components/schemas/TotalCount' CommentId: type: string example: 00000000-0000-1000-9000-510d9bb07630 description: Comment ID format: uuid CommentText: type: string example: | ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. description: Comment text format: text maxLength: 2000 minLength: 1 DateTime: type: string format: date-time description: Date and time in RFC-3339 example: '2024-11-29T12:09:53+00:00' CommentMention: type: object properties: mentionedUserId: type: string format: uuid mentionText: type: string required: - mentionedUserId - mentionText Comment: type: object required: - commentId - postId - commenterUserId - text - likeCount - likedByUser - edited - createdAt - updatedAt properties: commentId: $ref: '#/components/schemas/CommentId' postId: $ref: '#/components/schemas/PostId' commenterUserId: $ref: '#/components/schemas/UserId' text: $ref: '#/components/schemas/CommentText' likeCount: type: integer likedByUser: type: boolean edited: type: boolean createdAt: $ref: '#/components/schemas/DateTime' updatedAt: $ref: '#/components/schemas/DateTime' mentions: type: array items: $ref: '#/components/schemas/CommentMention' CommentsPage: type: object allOf: - $ref: '#/components/schemas/Page' - type: object properties: data: type: array items: $ref: '#/components/schemas/Comment' Error: type: object required: - code - message - endpoint - requestId properties: code: type: string description: Error unique code enum: - validation - internal - oops - unexpected - tooManyRequests - notFound - unauthorized - forbidden message: type: string description: Error message endpoint: type: string requestId: type: string Errors: type: object required: - errors properties: errors: type: array items: $ref: '#/components/schemas/Error' CreateComment: type: object required: - commenterUserId - text properties: commenterUserId: $ref: '#/components/schemas/UserId' text: $ref: '#/components/schemas/CommentText' mentions: type: array items: $ref: '#/components/schemas/CommentMention' UpdateComment: type: object required: - commenterUserId - text properties: commenterUserId: $ref: '#/components/schemas/UserId' text: $ref: '#/components/schemas/CommentText' LikeId: type: string example: 00000000-0000-1000-9000-510d9bb07630 description: Like ID format: uuid LikeUserId: type: string example: 00000000-0000-1000-9000-510d9bb07630 description: Like User ID format: uuid Like: type: object required: - postId - likeUserId - isLiked properties: likeId: $ref: '#/components/schemas/LikeId' postId: $ref: '#/components/schemas/PostId' commentId: $ref: '#/components/schemas/CommentId' likeUserId: $ref: '#/components/schemas/LikeUserId' isLiked: type: boolean createdAt: $ref: '#/components/schemas/DateTime' LikesPage: type: object allOf: - $ref: '#/components/schemas/Page' - type: object properties: data: type: array items: $ref: '#/components/schemas/Like' CreateReportRequest: type: object properties: description: type: string nullable: true description: Optional text description explaining why this content is being reported maxLength: 1000 parameters: CurrentUserId: name: x-current-user-id in: header required: true schema: $ref: '#/components/schemas/UserId' UserId: name: userId in: path required: true schema: $ref: '#/components/schemas/UserId' PostId: name: postId in: path required: true schema: $ref: '#/components/schemas/PostId' ParamPage: name: page required: false in: query schema: $ref: '#/components/schemas/PageNumber' Limit: name: limit required: false in: query schema: $ref: '#/components/schemas/PageLimit' TraceparentHeader: name: traceparent in: header required: false description: W3C Trace Context traceparent header for request tracing schema: type: string pattern: ^[0-9a-f]{2}-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$ example: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01 CommentId: name: commentId in: path required: true schema: $ref: '#/components/schemas/CommentId' responses: '400': description: Bad Request, the request is not valid content: application/json: schema: $ref: '#/components/schemas/Errors' example: errors: - code: 400 message: The request is not valid '403': description: Forbidden, you are not allowed to perform this action content: application/json: schema: $ref: '#/components/schemas/Errors' example: errors: - code: 403 message: You are not allowed to perform this action '404': description: Not found, the resource you are looking for does not exist content: application/json: schema: $ref: '#/components/schemas/Errors' example: errors: - code: 404 message: Resource not found