{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://anthemhayek.com/open-source/contact-card-kit/config.schema.json",
  "title": "DDNYC Contact Card Kit configuration",
  "type": "object",
  "additionalProperties": false,
  "required": ["firstName", "lastName", "fullName", "phone", "email", "website", "publicVcfUrl"],
  "properties": {
    "$schema": { "type": "string" },
    "firstName": { "type": "string", "minLength": 1 },
    "lastName": { "type": "string", "minLength": 1 },
    "fullName": { "type": "string", "minLength": 1 },
    "organization": { "type": "string" },
    "title": { "type": "string" },
    "phone": { "type": "string", "minLength": 3 },
    "email": { "type": "string", "format": "email" },
    "website": { "type": "string", "format": "uri", "pattern": "^https://" },
    "publicVcfUrl": { "type": "string", "format": "uri", "pattern": "^https://.*\\.vcf(?:[?#].*)?$" },
    "photoPath": { "type": "string", "description": "Optional path relative to config.json." },
    "photoUrl": { "type": "string", "format": "uri", "pattern": "^https://", "description": "Optional public HTTPS fallback for the contact photo." },
    "note": { "type": "string" },
    "socials": {
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          { "type": "string", "format": "uri" },
          {
            "type": "object",
            "additionalProperties": false,
            "required": ["url", "username"],
            "properties": {
              "url": { "type": "string", "format": "uri" },
              "username": { "type": "string", "minLength": 1 }
            }
          }
        ]
      }
    },
    "eventLabel": { "type": "string" },
    "cardTitleLines": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2,
      "items": { "type": "string", "maxLength": 24 }
    },
    "tagline": { "type": "string", "maxLength": 48 },
    "colors": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "paper": { "$ref": "#/$defs/color" },
        "accent": { "$ref": "#/$defs/color" },
        "signal": { "$ref": "#/$defs/color" },
        "ink": { "$ref": "#/$defs/color" }
      }
    }
  },
  "$defs": {
    "color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }
  }
}
