{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://backpr.com/standard/v1/contact.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": "Contact",
  "description": "An adult other than a guardian: an emergency contact, someone allowed to pick up, or both. A person in both lists must have the same id and details; readers merge by id. 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 grandparent, aunt or neighbor."
    },
    "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."
    },
    "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."
    },
    "priority": {
      "type": "integer",
      "minimum": 1,
      "description": "Order to call emergency contacts: 1 = call first."
    }
  },
  "required": [
    "id",
    "firstName",
    "lastName"
  ],
  "additionalProperties": true
}