{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://backpr.com/standard/v1/guardian.schema.json",
  "$comment": "Open Youth Registration format 1.x, BackPR, https://backpr.com/open-youth-registration. CC BY 4.0: https://creativecommons.org/licenses/by/4.0/",
  "title": "Guardian",
  "description": "A parent or legal guardian. Custom fields must start with x- (for example x-bunk); other names are reserved for this format. Software that rewrites a file must keep fields it doesn't recognize.",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "common.schema.json#/$defs/id"
    },
    "firstName": {
      "type": "string"
    },
    "lastName": {
      "type": "string"
    },
    "relationship": {
      "type": "string",
      "description": "For example mother, father, stepparent, grandparent or foster parent."
    },
    "phones": {
      "type": "array",
      "items": {
        "$ref": "common.schema.json#/$defs/phone"
      }
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "updatedAt": {
      "$ref": "common.schema.json#/$defs/dateTime",
      "description": "When this record last changed. When two files disagree, the later updatedAt wins."
    },
    "isLegalGuardian": {
      "type": "boolean"
    },
    "isPrimary": {
      "type": "boolean"
    },
    "address": {
      "$ref": "common.schema.json#/$defs/address"
    },
    "preferredLanguage": {
      "$ref": "common.schema.json#/$defs/language"
    },
    "participantIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Children this applies to, by participant id. If absent or empty, it applies to every child in the family."
    },
    "canPickUp": {
      "type": "boolean",
      "default": true,
      "description": "False if this guardian may not pick up."
    },
    "externalIds": {
      "$ref": "common.schema.json#/$defs/externalIds"
    }
  },
  "required": [
    "id",
    "firstName",
    "lastName"
  ],
  "additionalProperties": true
}