{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.trillsverse.com/trillsverse-property.schema.json",
  "title": "Trillsverse Property Protocol v1",
  "type": "object",
  "required": [
    "protocol",
    "protocolVersion",
    "id",
    "name",
    "canonicalUrl",
    "repository",
    "kind",
    "purpose",
    "owner",
    "partOf",
    "version",
    "aliases",
    "notSameAs",
    "relationships",
    "surfaces",
    "stateSources"
  ],
  "properties": {
    "protocol": {
      "const": "trillsverse-property"
    },
    "protocolVersion": {
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^TV-PROPERTY-[A-Z0-9-]+$"
    },
    "canonicalUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://"
    },
    "owner": {
      "const": "JohnBrajer"
    },
    "partOf": {
      "const": "Trillsverse"
    },
    "aliases": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "notSameAs": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "relationships": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "surfaces": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "url",
          "role",
          "index"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "role": {
            "type": "string"
          },
          "index": {
            "type": "boolean"
          }
        }
      }
    },
    "stateSources": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "url",
          "fields"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "fields": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "repository": {
      "type": "string",
      "minLength": 1
    },
    "kind": {
      "type": "string",
      "minLength": 1
    },
    "purpose": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string",
      "minLength": 1
    }
  }
}
