{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://theamateur.co.uk/ai-journalism/api/v1/schema/index.schema.json",
  "title": "AI Journalism API index",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "api_version",
    "name",
    "section",
    "description",
    "licence",
    "latest",
    "updated_at",
    "endpoints",
    "fair_use",
    "links",
    "pages"
  ],
  "properties": {
    "schema": {
      "type": "string",
      "minLength": 1,
      "format": "uri"
    },
    "api_version": {
      "const": "1.0"
    },
    "name": {
      "const": "AI Journalism"
    },
    "section": {
      "const": "AI Journalism"
    },
    "description": {
      "type": "string",
      "minLength": 1
    },
    "licence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "images_we_made",
        "text"
      ],
      "properties": {
        "images_we_made": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "name",
            "url",
            "statement"
          ],
          "properties": {
            "id": {
              "const": "theamateur-reuse-with-permission-1.0"
            },
            "name": {
              "const": "Reuse only with permission"
            },
            "url": {
              "const": "https://theamateur.co.uk/ai-journalism/images-and-licensing/#reuse"
            },
            "statement": {
              "const": "© THE AMATEUR LIMITED · Reuse only with permission (support@theamateur.co.uk)"
            }
          }
        },
        "text": {
          "const": "Stories © THE AMATEUR LIMITED. You may quote short extracts with a credit and a link; ask before any other reuse (support@theamateur.co.uk)."
        }
      }
    },
    "pages": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "corrections",
        "how_we_make_it"
      ],
      "properties": {
        "corrections": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "how_we_make_it": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        }
      }
    },
    "latest": {
      "type": "string",
      "minLength": 1,
      "pattern": "^\\d{4}-\\d{2}-\\d{2}(-dryrun)?$"
    },
    "updated_at": {
      "type": "string",
      "minLength": 1,
      "format": "date-time"
    },
    "endpoints": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "index",
        "latest",
        "editions",
        "edition",
        "story",
        "features",
        "feature",
        "images"
      ],
      "properties": {
        "index": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "latest": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "editions": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "edition": {
          "type": "string",
          "minLength": 1
        },
        "story": {
          "type": "string",
          "minLength": 1
        },
        "features": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "feature": {
          "type": "string",
          "minLength": 1
        },
        "images": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        }
      }
    },
    "fair_use": {
      "type": "string",
      "minLength": 1
    },
    "links": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "human",
        "licensing",
        "llms",
        "mcp"
      ],
      "properties": {
        "human": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "licensing": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "llms": {
          "type": "string",
          "minLength": 1,
          "format": "uri"
        },
        "mcp": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}
