{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-user-schema.json",
  "title": "User",
  "description": "User profile. Returned by `GET /users/{userId}`. Keys are emitted in snake_case\nfor the GET response to preserve frontend compatibility; the PATCH update response\nfrom `PATCH /users/{userId}` returns the underlying record in camelCase\n(`name`, `email`, `createdAt`, `updatedAt`). Treat unexpected casing tolerantly.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-users-api-openapi.yml#/components/schemas/User",
  "type": "object",
  "required": [
    "id"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "User identifier (Cognito sub claim)."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "User's email address (immutable — bound to Cognito identity and Stripe customer)."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Display name. May be null for users who haven't completed profile setup."
    },
    "avatar_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "URL of the user's avatar image (snake_case in this response per legacy compat)."
    },
    "theme_preference": {
      "type": "string",
      "enum": [
        "light",
        "dark",
        "brand",
        "system"
      ],
      "description": "User's preferred UI theme. Defaults to `system`."
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "ISO-8601 timestamp when the user record was created."
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "ISO-8601 timestamp of the last profile update."
    }
  }
}