get:
  tags:
    - Users
  summary: Return all users
  operationId: UsersGet
  description: >-
    Return a list of all existing users sorted by username in asc order. This
    API requires the current user to be member of group `Administrators`.
    Returns 403 otherwise. The `Administrators` group name is hardcoded and
    cannot be changed at the moment
  responses:
    '200':
      description: Successful Operation
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: ../components/schemas/UserGet.yaml
    '400':
      description: >-
        server runs on a static user-password pair, please use JSON file or
        database for user data
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '403':
      description: >-
        current user should belong to Administrators group to access this
        resource
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '500':
      description: Invalid Operation
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
post:
  tags:
    - Users
  summary: Create a new user
  operationId: UsersPost
  description: >-
    Create a new user. This API requires the current user to be member of group
    `Administrators`. Returns 403 otherwise. The `Administrators` group name is
    hardcoded and cannot be changed at the moment
  requestBody:
    description: User to create.
    content:
      '*/*':
        schema:
          $ref: ../components/schemas/UserPost.yaml
    required: true
  responses:
    '201':
      description: Successful Operation
      content: {}
    '400':
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '403':
      description: >-
        current user should belong to Administrators group to access this
        resource
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
    '500':
      description: Invalid Operation
      content:
        application/json:
          schema:
            $ref: ../components/schemas/ErrorPayload.yaml
  x-codegen-request-body-name: user
