{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://loopback.social/schemas/communities.schema.json",
  "title": "Loopback Social Communities",
  "description": "Schema for docs/communities.json — communities listed in the banner dropdown.",
  "type": "array",
  "items": { "$ref": "#/definitions/community" },
  "definitions": {
    "community": {
      "type": "object",
      "required": ["name", "url"],
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/definitions/localizedString",
          "description": "Display name. String or { ko, en } object."
        },
        "url": {
          "$ref": "#/definitions/localizedString",
          "description": "Community URL. String or { ko, en } object."
        },
        "feed": {
          "$ref": "#/definitions/localizedString",
          "description": "Optional RSS/Atom feed URL exposed in feeds.opml so subscribers can pick up this community's own posts."
        },
        "network_url": {
          "$ref": "#/definitions/localizedString",
          "description": "URL of this community's Loopback Social news source JSON (must match news.schema.json). Single string, or { ko, en } when separate URLs per language (max 2 URLs). Aggregator pulls top items here automatically on a 6-hour cron."
        }
      }
    },
    "localizedString": {
      "oneOf": [
        { "type": "string", "minLength": 1 },
        {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": { "type": "string", "minLength": 1 },
          "properties": {
            "ko": { "type": "string", "minLength": 1 },
            "en": { "type": "string", "minLength": 1 }
          }
        }
      ]
    }
  }
}
