{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phoenix/json-schema/phoenix-get-users-response-body-schema.json",
  "title": "GetUsersResponseBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phoenix-users-api-openapi.yml#/components/schemas/GetUsersResponseBody",
  "properties": {
    "data": {
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/LocalUser"
          },
          {
            "$ref": "#/$defs/OAuth2User"
          },
          {
            "$ref": "#/$defs/LDAPUser"
          }
        ]
      },
      "type": "array",
      "title": "Data"
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "title": "Next Cursor"
    }
  },
  "type": "object",
  "required": [
    "data",
    "next_cursor"
  ],
  "$defs": {
    "LDAPUser": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "email": {
          "type": "string",
          "title": "Email"
        },
        "username": {
          "type": "string",
          "title": "Username"
        },
        "role": {
          "type": "string",
          "enum": [
            "SYSTEM",
            "ADMIN",
            "MEMBER",
            "VIEWER"
          ],
          "title": "Role"
        },
        "auth_method": {
          "type": "string",
          "const": "LDAP",
          "title": "Auth Method"
        }
      },
      "type": "object",
      "required": [
        "id",
        "created_at",
        "updated_at",
        "email",
        "username",
        "role",
        "auth_method"
      ],
      "title": "LDAPUser"
    },
    "LocalUser": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "email": {
          "type": "string",
          "title": "Email"
        },
        "username": {
          "type": "string",
          "title": "Username"
        },
        "role": {
          "type": "string",
          "enum": [
            "SYSTEM",
            "ADMIN",
            "MEMBER",
            "VIEWER"
          ],
          "title": "Role"
        },
        "auth_method": {
          "type": "string",
          "const": "LOCAL",
          "title": "Auth Method"
        },
        "password": {
          "type": "string",
          "title": "Password"
        },
        "password_needs_reset": {
          "type": "boolean",
          "title": "Password Needs Reset"
        }
      },
      "type": "object",
      "required": [
        "id",
        "created_at",
        "updated_at",
        "email",
        "username",
        "role",
        "auth_method",
        "password_needs_reset"
      ],
      "title": "LocalUser"
    },
    "OAuth2User": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "title": "Updated At"
        },
        "email": {
          "type": "string",
          "title": "Email"
        },
        "username": {
          "type": "string",
          "title": "Username"
        },
        "role": {
          "type": "string",
          "enum": [
            "SYSTEM",
            "ADMIN",
            "MEMBER",
            "VIEWER"
          ],
          "title": "Role"
        },
        "auth_method": {
          "type": "string",
          "const": "OAUTH2",
          "title": "Auth Method"
        },
        "oauth2_client_id": {
          "type": "string",
          "title": "Oauth2 Client Id"
        },
        "oauth2_user_id": {
          "type": "string",
          "title": "Oauth2 User Id"
        },
        "profile_picture_url": {
          "type": "string",
          "title": "Profile Picture Url"
        }
      },
      "type": "object",
      "required": [
        "id",
        "created_at",
        "updated_at",
        "email",
        "username",
        "role",
        "auth_method"
      ],
      "title": "OAuth2User"
    }
  }
}