{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/freifunk-de-community-api/versions/0.2.0.json",
  "description": "Freifunk Community API 0.2.0",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/freifunk/api.freifunk.net/master/specs/0.2.0.json",
    "sourceSha256": "2e1163075705debc327b633b8ee2045d33767e329ab40a186a97e422e52ac128",
    "fileMatch": [
      "*.freifunk-api.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "api": {
      "type": "string",
      "title": "API",
      "description": "The Freifunk Community API version you use",
      "enum": [
        "0.1",
        "0.2.0"
      ],
      "default": "0.2.0"
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "The name of your community"
    },
    "metacommunity": {
      "type": "string",
      "title": "Metacommunity",
      "description": "The name of your metacommunity, if your local community belongs to a bigger one"
    },
    "location": {
      "title": "Location",
      "type": "object",
      "required": [
        "city",
        "lat",
        "lon"
      ],
      "description": "Position data such as a postal address or geographic coordinates",
      "properties": {
        "city": {
          "$ref": "#/$defs/city"
        },
        "address": {
          "$ref": "#/$defs/address"
        },
        "lat": {
          "$ref": "#/$defs/lat"
        },
        "lon": {
          "$ref": "#/$defs/lon"
        }
      },
      "additionalProperties": false
    },
    "contact": {
      "type": "object",
      "properties": {
        "email": {
          "$ref": "#/$defs/email",
          "title": "Email",
          "description": "Email address to which other people can contact your community (user@domain.com)"
        },
        "facebook": {
          "type": "string",
          "title": "facebook",
          "description": "URL to your community's facebook account (https://facebook.com/...)",
          "pattern": "^(http|https)://([a-z\\-]*\\.|)facebook\\.com/[A-Za-z0-9ÄÖÜäöüß\\-_\\.]+"
        },
        "identica": {
          "type": "string",
          "title": "identica",
          "description": "URL to your community's identica account"
        },
        "irc": {
          "type": "string",
          "title": "IRC",
          "description": "Your community's ICR channel"
        },
        "jabber": {
          "type": "string",
          "title": "Jabber",
          "description": "A jabber account someone reads"
        },
        "ml": {
          "type": "string",
          "title": "Mailinglist",
          "description": "The email address (user@domain.com) of your mailing list or a link to the mailinglist info page",
          "pattern": "^([A-Za-z0-9äöüÄÖUß_\\-\\.]+@[A-Za-z0-9äöüÄÖUß_\\-\\.]+\\.[A-Za-z]{2,}|(http|https)://[A-Za-z0-9ÄÖÜäöüß\\-_\\./]+)$"
        },
        "googleplus": {
          "type": "string",
          "title": "Google+",
          "description": "URL to your community's g+ account"
        },
        "twitter": {
          "type": "string",
          "title": "Twitter",
          "description": "Your community's Twitter name (starts with @)",
          "pattern": "^@[A-Za-z0-9]{1,15}"
        },
        "phone": {
          "$ref": "#/$defs/phone",
          "title": "Phone",
          "description": "If your community has a phone number"
        }
      },
      "minProperties": 1,
      "additionalProperties": false
    },
    "url": {
      "title": "HomePage",
      "$ref": "#/$defs/url",
      "description": "The main website"
    },
    "timeline": {
      "type": "array",
      "description": "These are lifetime events something like date of birth (and rebirth :-) of your community or other important milestones",
      "items": {
        "type": "object",
        "properties": {
          "decription": {
            "type": "string",
            "title": "Description",
            "description": "Description of your lifetime event"
          },
          "timestamp": {
            "type": "string",
            "title": "Timestamp",
            "description": "ISO 8601 timestamp of the event's date (format yyyy-mm-dd)"
          }
        },
        "additionalProperties": false
      }
    },
    "events": {
      "description": "URL to your calendar ics file that can be imported to a global calendar",
      "title": "Events",
      "type": "string"
    },
    "feeds": {
      "type": "array",
      "title": "Feeds",
      "description": "Feeds you provide your community",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "title": "Feed name",
            "description": "Name of the feed"
          },
          "category": {
            "type": "string",
            "title": "Feed category",
            "description": "Category of the feed like blog entries, calendars, forum messages, wiki articles, ...",
            "enum": [
              "blog",
              "forum",
              "wiki",
              "others",
              ""
            ],
            "default": ""
          },
          "type": {
            "type": "string",
            "title": "Feed Type",
            "description": "Type of the feed like RSS, Atom, XML"
          },
          "url": {
            "$ref": "#/$defs/url",
            "title": "URL",
            "description": "URL of the feed"
          }
        },
        "additionalProperties": false
      }
    },
    "state": {
      "type": "object",
      "required": [
        "lastchange"
      ],
      "title": "States",
      "description": "A collection of status-related data. Actual open/closed status, icons, last change timestamp etc.",
      "properties": {
        "nodes": {
          "type": "integer",
          "minimum": 0,
          "title": "Active Nodes",
          "description": "Number of active nodes"
        },
        "lastchange": {
          "type": "number",
          "title": "Last Change",
          "format": "date-time",
          "description": "At what ISO 8601 timestamp has your community status lastly changed?"
        },
        "message": {
          "type": "string",
          "title": "Message",
          "description": "A free-form string something like 'open for public', 'members only' or whatever you want it to be)"
        }
      },
      "additionalProperties": false
    },
    "nodeMaps": {
      "type": "array",
      "title": "Nodes",
      "description": "Maps of nodes or topology your community provides",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "$ref": "#/$defs/url",
            "title": "URL of the map",
            "description": "The URL where the map is located"
          },
          "interval": {
            "type": "string",
            "title": "interval",
            "description": "How often the map will be refreshed"
          },
          "technicalType": {
            "type": "string",
            "title": "map techincal type",
            "description": "The kind of map is used",
            "enum": [
              "",
              "ffmap",
              "olsr-dot",
              "openwifimap"
            ],
            "default": ""
          },
          "mapType": {
            "type": "string",
            "title": "Maptype",
            "description": "",
            "enum": [
              "",
              "geographical",
              "structural",
              "list/status"
            ],
            "default": ""
          }
        },
        "title": "node",
        "additionalProperties": false
      }
    },
    "techDetails": {
      "type": "object",
      "properties": {
        "bootstrap": {
          "description": "how to deal with fresh routers",
          "title": "Bootstrap",
          "type": "string"
        },
        "firmware": {
          "type": "object",
          "properties": {
            "url": {
              "$ref": "#/$defs/url",
              "title": "Firmware download and docs",
              "description": "Link to your firmware images and docs"
            },
            "name": {
              "type": "string",
              "title": "Firmware Name",
              "description": "Name of your firmware"
            }
          },
          "additionalProperties": false
        },
        "keyexchange": {
          "description": "needs to be defined",
          "type": "string"
        },
        "networks": {
          "type": "object",
          "properties": {
            "ipv6": {
              "type": "array",
              "description": "IPv6 networks used by your community",
              "items": {
                "type": "object",
                "properties": {
                  "prefix": {
                    "description": "ipv6 network prefix",
                    "type": "string"
                  },
                  "prefixlength": {
                    "description": "prefix length",
                    "type": "integer"
                  }
                },
                "title": "ipv6 network object",
                "additionalProperties": false
              }
            },
            "ipv4": {
              "type": "array",
              "description": "IPv4 networks used by your community",
              "items": {
                "type": "object",
                "properties": {
                  "netmask": {
                    "description": "the netmask valid for this network",
                    "type": "integer"
                  },
                  "network": {
                    "description": "network name (e.g. 10.63.x.y)",
                    "type": "string"
                  }
                },
                "title": "ipv4 network object",
                "additionalProperties": false
              }
            }
          },
          "title": "Networks",
          "description": "Networks used by your community",
          "additionalProperties": false
        },
        "routing": {
          "default": "",
          "description": "routing protocol used within your community",
          "enum": [
            "",
            "OLSR",
            "BATMAN",
            "Babel",
            "802.11s"
          ],
          "title": "Routing protocol"
        },
        "splashpage": {
          "description": "what kind of splashpage does your community use?",
          "title": "Splash Page",
          "type": "string"
        },
        "stoererhaftung": {
          "description": "how the German störerhaftung is handled",
          "title": "Störerhaftung",
          "type": "string"
        },
        "topodata": {
          "description": "link to your topology data (dot-files? needs to be defined)",
          "title": "Topology data",
          "type": "string"
        },
        "updatemode": {
          "description": "how do you deploy firmware updates?",
          "title": "Updatemode",
          "type": "string"
        },
        "vpn": {
          "description": "implementation of inner city vpn",
          "title": "VPN",
          "type": "string"
        }
      },
      "description": "Technical details of your community's Freifunk implementation",
      "additionalProperties": false
    }
  },
  "$defs": {
    "city": {
      "type": "string",
      "title": "City",
      "description": "Name of the city"
    },
    "address": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "title": "Name of your place",
          "description": "The name of the place you meet"
        },
        "Street": {
          "type": "string",
          "title": "Street",
          "description": "The street address of your meeting place"
        },
        "Zipcode": {
          "type": "string",
          "title": "ZIP",
          "description": "The zip code of your meeting place"
        }
      },
      "description": "The address of the place you meet",
      "additionalProperties": false
    },
    "lat": {
      "type": "number",
      "title": "Latitude",
      "description": "Lattitude of your city"
    },
    "lon": {
      "type": "number",
      "title": "Longitude",
      "description": "Longitude of your city"
    },
    "email": {
      "type": "string",
      "title": "Email",
      "format": "email",
      "pattern": "^[A-Za-z0-9äöüÄÖUß_\\-\\.]+@[A-Za-z0-9äöüÄÖUß_\\-\\.]+\\.[A-Za-z]{2,}$"
    },
    "url": {
      "type": "string",
      "pattern": "^(http|https)://[A-Za-z0-9ÄÖÜäöüß\\-_\\./]+"
    },
    "phone": {
      "type": "string",
      "title": "Phone"
    }
  },
  "required": [
    "name",
    "location",
    "contact",
    "url",
    "state"
  ],
  "additionalProperties": false
}
