post:
  summary: Invite a user to the project, join the project, send request to join project
  parameters:
    - in: path
      name: projectId
      required: true
      schema:
        type: string
      description: Project ID
  operationId: rest.project.participants.post
  security:
    - jwt: []
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../components/components.yaml#/components/schemas/profile_id_request'
  responses:
    201:
      description: Successfully added new participant to the project
      content:
        application/json:
          schema:
            $ref: '../components/components.yaml#/components/schemas/list_of_users'
    404:
      $ref: '../components/components.yaml#/components/responses/404NotFound'
    default:
      $ref: '../components/components.yaml#/components/responses/UnexpectedError'

get:
  summary: View the project participants list
  parameters:
    - in: path
      name: projectId
      required: true
      schema:
        type: string
      description: Project ID
    - $ref: '../components/components.yaml#/components/parameters/offset_param'
    - $ref: '../components/components.yaml#/components/parameters/limit_param'
  operationId: rest.project.participants.index
  security:
    - jwt: []
  responses:
    200:
      description: Successfully fetch a list of the project participants
      content:
        application/json:
          schema:
            $ref: '../components/components.yaml#/components/schemas/list_of_users'
    404:
      $ref: '../components/components.yaml#/components/responses/404NotFound'
    default:
      $ref: '../components/components.yaml#/components/responses/UnexpectedError'

put:
  summary: User accept or reject invitation to become the project participant
  parameters:
    - in: path
      name: projectId
      required: true
      schema:
        type: string
      description: Project ID
  operationId: rest.project.participants.put
  security:
    - jwt: []
  responses:
    200:
      description: Successfully status of the project updated
      content:
        application/json:
          schema:
            $ref: '../components/components.yaml#/components/responses/invitationStatus'
    404:
      $ref: '../components/components.yaml#/components/responses/404NotFound'
    default:
      $ref: '../components/components.yaml#/components/responses/UnexpectedError'
