{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/UserAccount/v1/schema.json",
  "title": "UserAccount Schema",
  "description": "Objects Grid UserAccount Object",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique identifier for an Object",
      "type": "string",
      "minLength": 36,
      "maxLength": 36
    },
    "person": {
      "description": "URL of the Person this account belongs to, which holds the account's personal data (name, email, address). Created with the account; empty once the person is erased.",
      "type": ["string", "null"],
      "format": "uri"
    },
    "identities": {
      "description": "The sign-in identities the account signs in with: the iss and sub claims of ID tokens. Added by signing in, or by the account itself with POST /useraccounts/{id}/identities (a second provider, such as Apple next to Google); an update may only remove them all, with [], as an erasure does.",
      "type": ["array", "null"],
      "items": {
        "type": "object",
        "properties": {"iss": {"type": "string"}, "sub": {"type": "string"}},
        "required": ["iss", "sub"]
      }
    },
    "disabled": {
      "description": "Is the UserAccount disabled",
      "type": "boolean"
    },
    "tags": {
      "description": "Tags an ABAC policy can decide on. A name may repeat; the same name and value appear once. Every stored object has them: created empty when not sent, kept by a replacement (PUT) that does not mention them, unchanged by a patch that does not mention them, cleared by null or [].",
      "type": "array",
      "default": [],
      "uniqueItems": true,
      "maxItems": 50,
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Tag/v1/schema.json"
      }
    }
  },
  "required": ["id", "disabled", "tags"]
}