openapi: 3.0.3
info:
  title: Example API
  version: 1.0.0
paths:
  /users:
    get:
      summary: List users
      parameters:
        - in: query
          name: sort
          schema:
            type: string
            enum:
              - createdAt
              - username
      responses:
        '200':
          description: A list of users
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserList"
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
          readOnly: true
          description: Unique user id
        username:
          type: string
          maxLength: 60
          description: Unique username
        firstname:
          type: string
          maxLength: 100
        lastname:
          type: string
          maxLength: 100
        email:
          type: string
          format: email
        emailVerified:
          type: boolean
          default: false
        createdAt:
          type: string
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          format: date-time
          readOnly: true
      required:
        - id
        - username
        - email
      example:
        id: 100001
        username: jd
        firstname: John
        lastname: Doe
        email: john.doe@mail.com
        emailVerified: true
        createdAt: 2025-07-09T17:14:53+00:00
        updatedAt: 2025-07-10T11:25:40+00:00
    UserList:
      type: object
      properties:
        totalItems:
          type: integer
          readOnly: true
        users:
          type: array
          items:
            $ref: "#/components/schemas/User"
          readOnly: true
      required:
        - totalItems
        - users
