{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Galaxy Registry Summary",
  "description": "Discovery-focused component catalog. Use registry-<framework>.json for framework-specific source-of-truth data.",
  "type": "object",
  "required": ["components", "groups"],
  "properties": {
    "components": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/componentSummary"
      }
    },
    "groups": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/componentGroup"
      }
    }
  },
  "definitions": {
    "framework": {
      "type": "string",
      "enum": [
        "react",
        "nextjs",
        "vue",
        "nuxtjs",
        "angular",
        "react-native",
        "flutter"
      ]
    },
    "componentGroup": {
      "type": "object",
      "required": ["name", "components"],
      "properties": {
        "name": {
          "type": "string"
        },
        "components": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "propType": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "values": {
          "type": "array"
        },
        "of": {}
      },
      "additionalProperties": true
    },
    "propOverride": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/propType"
        },
        "default": {},
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "propDefinition": {
      "type": "object",
      "required": ["name", "type", "frameworks"],
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "$ref": "#/definitions/propType"
        },
        "default": {},
        "description": {
          "type": "string"
        },
        "frameworks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/framework"
          }
        },
        "overrides": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/propOverride"
          }
        }
      },
      "additionalProperties": true
    },
    "childComponent": {
      "type": "object",
      "required": ["name", "props"],
      "properties": {
        "name": {
          "type": "string"
        },
        "props": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/propDefinition"
          }
        }
      },
      "additionalProperties": false
    },
    "componentSummary": {
      "type": "object",
      "required": ["name", "type", "description", "category", "frameworks"],
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "form",
            "layout",
            "navigation",
            "feedback",
            "data-display",
            "modal-overlay",
            "interactive",
            "charts",
            "block",
            "other"
          ]
        },
        "description": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "frameworks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/framework"
          }
        },
        "props": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/propDefinition"
          }
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/childComponent"
          }
        }
      },
      "additionalProperties": true
    }
  }
}
