{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Comparison Table Data Schema",
  "description": "Schema for Ordio pricing comparison table data",
  "type": "object",
  "required": ["metadata", "categories", "plans"],
  "properties": {
    "metadata": {
      "type": "object",
      "required": ["version", "last_updated", "total_categories", "total_features"],
      "properties": {
        "version": {
          "type": "string",
          "description": "Data version (semantic versioning)"
        },
        "last_updated": {
          "type": "string",
          "format": "date",
          "description": "Last update date (YYYY-MM-DD)"
        },
        "total_categories": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of categories"
        },
        "total_features": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of features across all categories"
        }
      }
    },
    "categories": {
      "type": "array",
      "description": "Array of feature categories",
      "items": {
        "type": "object",
        "required": ["id", "name", "slug", "order", "features"],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique category identifier (kebab-case)"
          },
          "name": {
            "type": "string",
            "description": "Category display name"
          },
          "slug": {
            "type": "string",
            "description": "URL-friendly category slug"
          },
          "url": {
            "type": ["string", "null"],
            "description": "Optional URL to category page"
          },
          "order": {
            "type": "integer",
            "minimum": 1,
            "description": "Display order (1-based)"
          },
          "features": {
            "type": "array",
            "description": "Array of features in this category",
            "items": {
              "type": "object",
              "required": ["name", "plans"],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Feature display name"
                },
                "plans": {
                  "type": "object",
                  "required": ["starter", "plus", "pro", "enterprise"],
                  "properties": {
                    "starter": {
                      "type": "string",
                      "enum": ["check", "check_blue", "cross", "unknown"],
                      "description": "Feature availability in Starter plan"
                    },
                    "plus": {
                      "type": "string",
                      "enum": ["check", "check_blue", "cross", "unknown"],
                      "description": "Feature availability in Plus plan"
                    },
                    "pro": {
                      "type": "string",
                      "enum": ["check", "check_blue", "cross", "unknown"],
                      "description": "Feature availability in Pro plan (check_blue indicates highlighted)"
                    },
                    "enterprise": {
                      "type": "string",
                      "enum": ["check", "check_blue", "cross", "unknown"],
                      "description": "Feature availability in Enterprise plan"
                    }
                  }
                },
                "tooltip": {
                  "type": ["string", "null"],
                  "description": "Optional tooltip text for feature"
                },
                "description": {
                  "type": ["string", "null"],
                  "description": "Optional detailed description"
                }
              }
            }
          }
        }
      }
    },
    "plans": {
      "type": "object",
      "description": "Plan-based feature organization",
      "required": ["starter", "plus", "pro", "enterprise"],
      "properties": {
        "starter": {
          "type": "array",
          "description": "Features available in Starter plan",
          "items": {
            "type": "object",
            "required": ["name", "category", "category_id", "icon_type"],
            "properties": {
              "name": {
                "type": "string",
                "description": "Feature name"
              },
              "category": {
                "type": "string",
                "description": "Category name this feature belongs to"
              },
              "category_id": {
                "type": "string",
                "description": "Category ID"
              },
              "icon_type": {
                "type": "string",
                "enum": ["check", "check_blue"],
                "description": "Icon type for this plan"
              }
            }
          }
        },
        "plus": {
          "type": "array",
          "description": "Features available in Plus plan"
        },
        "pro": {
          "type": "array",
          "description": "Features available in Pro plan"
        },
        "enterprise": {
          "type": "array",
          "description": "Features available in Enterprise plan"
        }
      }
    }
  }
}

