{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://slopfarm.games/schemas/project.json",
  "title": "Slop Farm project manifest",
  "type": "object",
  "additionalProperties": false,
  "required": ["title", "category", "madeWith", "build", "entry"],
  "properties": {
    "$schema": { "type": "string", "const": "https://slopfarm.games/schemas/project.json" },
    "projectId": { "type": ["string", "null"], "format": "uuid" },
    "title": { "type": "string", "minLength": 1, "maxLength": 120 },
    "description": { "type": "string", "maxLength": 2000 },
    "category": {
      "enum": ["Action", "Puzzle", "Platformer", "Shooter", "Racing", "RPG", "Strategy", "Arcade", "Simulation", "Other"]
    },
    "tags": {
      "type": "array",
      "maxItems": 8,
      "uniqueItems": true,
      "items": { "type": "string", "maxLength": 24, "pattern": "^[a-z0-9-]+$" }
    },
    "madeWith": {
      "type": "array",
      "minItems": 1,
      "maxItems": 8,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 1, "maxLength": 40 }
    },
    "sourceUrl": {
      "type": ["string", "null"],
      "pattern": "^https://(?:www\\.)?github\\.com/[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+(?:\\.git)?/?$"
    },
    "build": {
      "type": "object",
      "additionalProperties": false,
      "required": ["command", "output"],
      "properties": {
        "command": { "type": "string" },
        "output": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.\\.?$)(?!.*(?:^|/)\\.\\.(?:/|$))(?!/)(?![A-Za-z]:)[^\\\\\\u0000]+$"
        }
      }
    },
    "entry": {
      "type": "string",
      "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!/)(?![A-Za-z]:)[^\\\\\\u0000]+\\.html?$"
    }
  }
}
