get:
  operationId: getUserById
  tags:
    - users
  summary: Returns an user.
  parameters:
    - $ref: '#/components/parameters/userId'
  responses:
    200:
      description: OK
      content:
        application/json:
          schema:
            allOf:
              - $ref: '../schemas/User.yaml'
              - type: object
                properties:
                  company:
                    $ref: '../schemas/Company.yaml'
                  warehouses:
                    type: array
                    items:
                      $ref: '../schemas/Warehouse.yaml'
                  userAuths:
                    type: array
                    items:
                      $ref: '../schemas/UserAuth.yaml'
put:
  operationId: putUserById
  tags:
    - users
  summary: Updates an user
  parameters:
    - $ref: '#/components/parameters/userId'
  requestBody:
    required: true
    content:
      application/json:
        schema:
          type: object
          properties:
            email:
              type: string
            lastname:
              type: string
            firstname:
              type: string
            company:
              type: object
              properties:
                id:
                  type: string
  responses:
    200:
      description: OK
      content:
        application/json:
          schema:
            allOf:
              - $ref: '../schemas/User.yaml'
              - type: object
                properties:
                  company:
                    $ref: '../schemas/Company.yaml'
delete:
  operationId: deleteUserById
  tags:
    - users
  summary: Deletes an user
  parameters:
    - $ref: '#/components/parameters/userId'
  responses:
    204:
      description: Deleted

components:
  parameters:
    userId:
      in: path
      name: userId
      required: true
      description: UUID of the user
      schema:
        type: string
