Comments

Create a comment

Changed on

Add a comment to a post to share your thoughts

post/posts/{postId}/comments

Request

  • Base URL
    http://localhost:8080/api
  • URL
    http://localhost:8080/api/posts/{postId}/comments
  • Auth
    none declared

Path parameters

postIdstring uuid required
Example:123e4567-e89b-12d3-a456-426614174000

Unique identifier of the post

Request body

usernamestring required

Username of the comment author

contentstring required

Content of the comment

Example request

{
  "username": "jane_smith",
  "content": "Great photo! Where was this taken?"
}

Response

Comment created successfully

idstring uuid required

Unique identifier for the comment

postIdstring uuid required

ID of the post this comment belongs to

usernamestring required

Username of the comment author

contentstring required

Content of the comment

createdAtstring date-time required

Timestamp when the comment was created

updatedAtstring date-time required

Timestamp when the comment was last updated

Example response

{
  "id": "987fcdeb-51a2-43d1-9f6b-123456789abc",
  "postId": "123e4567-e89b-12d3-a456-426614174000",
  "username": "jane_smith",
  "content": "Great photo! Where was this taken?",
  "createdAt": "2025-06-01T11:15:00Z",
  "updatedAt": "2025-06-01T11:15:00Z"
}

Changes

    • breaking

      added the new path request parameter postId

    • breaking

      the response property's maxLength was increased from 500 to 1000 for the response status

    • breaking

      the response's property type changed from object to array for status

    • breaking

      the response's property type changed from object to array for status

    • breaking

      the response's property type changed from object to array for status

    • info

      the request property's maxLength was increased from 500 to 1000

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the response's property type changed from integer to string, and format from no format to uuid for status

    • breaking

      the response's property type changed from integer to string, and format from no format to uuid for status

    • warning

      deleted the path request parameter postId

    • warning

      the request property's maxLength was set to 500

    • warning

      the request property's maxLength was set to 50

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status