get:
  summary: List all the package's comments
  description: List all the comments for the package.
  security:
    - basic_authentication: []
  parameters:
    - $ref: '../components/parameters/project_name.yaml'
    - $ref: '../components/parameters/package_name.yaml'
  responses:
    '200':
      description: OK. The request has succeeded.
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/comments.yaml'
          example: |
            <comments project="home:Admin" package="0ad">
              <comment who="Iggy" when="2021-10-15 13:28:22 UTC" id="1">This is a pretty cool comment!</comment>
            </comments>
    '401':
      $ref: '../components/responses/unauthorized.yaml'
    '404':
      description: |
        Not found.

        XML Schema used for body validation: [status.rng](../schema/status.rng)
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/api_response.yaml'
          examples:
            not_found:
              summary: 'Package not found: home:Admin/notapackage'
              value:
                code: not_found
                summary: 'Package not found: home:Admin/notapackage'
  tags:
    - Comments

post:
  summary: Create a package comment
  description: Create a comment for the package.
  security:
    - basic_authentication: []
  parameters:
    - $ref: '../components/parameters/project_name.yaml'
    - $ref: '../components/parameters/package_name.yaml'
    - in: query
      name: parent_id
      schema:
        type: integer
      description: Id of the comment to reply to
      example: 10401
  requestBody:
    description: Content of the comment
    required: true
    content:
      text/plain:
        schema:
          type: string
        example: This is a very valuable comment
  responses:
    '200':
      $ref: '../components/responses/succeeded.yaml'
    '400':
      description: |
        Invalid Comment.

        XML Schema used for body validation: [status.rng](../schema/status.rng)
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/api_response.yaml'
          examples:
            invalid_record:
              summary: Parent belongs to different object
              value:
                code: invalid_record
                summary: Parent belongs to different object
    '401':
      $ref: '../components/responses/unauthorized.yaml'
    '404':
      description: |
        Not found.

        XML Schema used for body validation: [status.rng](../schema/status.rng)
      content:
        application/xml; charset=utf-8:
          schema:
            $ref: '../components/schemas/api_response.yaml'
          examples:
            not_found:
              summary: 'Package not found: openSUSE:Factory/eeee'
              value:
                code: not_found
                summary: 'Package not found: openSUSE:Factory/eeee'
  tags:
    - Comments
