{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://living-bread.org/protocol/v0.1/church.schema.json",
  "title": "Kingdom Protocol v0.1: Church",
  "description": "A local church. The app's churches carry what a verified church said about itself; the open directory carries public data from OpenStreetMap and Wikidata. Verified and unclaimed listings are always distinguished.",
  "type": "object",
  "required": [
    "id",
    "name"
  ],
  "properties": {
    "id": {
      "description": "Stable id",
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "description": "Name",
      "type": "string"
    },
    "denomination": {
      "description": "Tradition or denomination",
      "type": [
        "string",
        "null"
      ]
    },
    "city": {
      "description": "City",
      "type": [
        "string",
        "null"
      ]
    },
    "region": {
      "description": "State or region",
      "type": [
        "string",
        "null"
      ]
    },
    "country": {
      "description": "Country",
      "type": [
        "string",
        "null"
      ]
    },
    "lat": {
      "description": "Latitude, four decimals (a public building)",
      "type": [
        "number",
        "null"
      ]
    },
    "lon": {
      "description": "Longitude, four decimals",
      "type": [
        "number",
        "null"
      ]
    },
    "website": {
      "description": "Website",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "description": {
      "description": "The church's own words",
      "type": [
        "string",
        "null"
      ]
    },
    "service_times": {
      "description": "Service times as the church wrote them",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "object"
        ]
      }
    },
    "languages": {
      "description": "Languages of worship",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "object"
        ]
      }
    },
    "accessibility": {
      "description": "Accessibility",
      "type": [
        "string",
        "null"
      ]
    },
    "logo_url": {
      "description": "Logo",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "cover_url": {
      "description": "Cover image",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "social_links": {
      "description": "Where its people already talk (WhatsApp group, Telegram, and the rest)",
      "type": [
        "object",
        "null"
      ]
    },
    "verified": {
      "description": "Verified church on The Living Bread",
      "type": [
        "boolean",
        "null"
      ]
    },
    "claimed": {
      "description": "Claimed by its leaders",
      "type": [
        "boolean",
        "null"
      ]
    },
    "upcoming_gatherings": {
      "description": "How many public gatherings are ahead",
      "type": [
        "integer",
        "null"
      ]
    },
    "updated_at": {
      "description": "Last change",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "additionalProperties": true,
  "x-lb-urn": "lb:church:<uuid> (a church on the app) or lb:church:<slug> and lb:church:<country>/<slug> (the open directory)",
  "x-lb-schema-org": "https://schema.org/Church",
  "x-lb-door": "/api/church/{uuid}, /api/church/{country}/{slug}, /api/nearby",
  "x-lb-license": "Directory data CC BY 4.0. Words written by people remain theirs; quote with attribution."
}