{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://loult.fr/interloult/schema/0.1/balise.json",
  "title": "Balise InterLoult 0.1",
  "type": "object",
  "required": ["interloult", "name", "url", "description", "languages", "kinds", "charter", "neighbors", "updated"],
  "properties": {
    "interloult": { "const": "0.1" },
    "name": { "type": "string", "minLength": 1, "maxLength": 60 },
    "url": { "type": "string", "pattern": "^https://.+/$" },
    "description": { "type": "string", "maxLength": 200 },
    "languages": { "type": "array", "minItems": 1, "items": { "type": "string" } },
    "kinds": {
      "type": "array",
      "minItems": 1,
      "items": { "enum": ["chat", "blog", "forum", "wiki", "radio", "game", "art", "tool", "library", "other"] }
    },
    "charter": { "const": "0.1" },
    "contact": { "type": "string", "pattern": "^(https|mailto|xmpp):" },
    "neighbors": { "type": "array", "maxItems": 100, "items": { "type": "string", "pattern": "^https://.+/$" } },
    "modules": {
      "type": "object",
      "properties": {
        "showcase": { "type": "string", "pattern": "^https://" },
        "escale": { "type": "string", "pattern": "^https://" },
        "key": { "type": "object", "required": ["kty", "crv", "x"] },
        "shared_rooms": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["name", "endpoint", "peers", "rules"],
            "properties": {
              "name": { "type": "string", "maxLength": 40 },
              "peers": { "type": "array", "items": { "type": "string", "pattern": "^https://.+/$" } },
              "endpoint": { "type": "string", "pattern": "^wss://" },
              "rules": { "type": "string", "pattern": "^https://" }
            }
          }
        },
        "commons": { "type": "array", "items": { "type": "object", "required": ["kind", "url"] } },
        "feed": { "type": "string", "pattern": "^https://" },
        "fediverse": { "type": "string", "pattern": "^@[^@]+@[^@]+$" }
      }
    },
    "montage": { "type": "string", "pattern": "^https://" },
    "updated": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}" }
  }
}
