{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": [
    "library",
    "version",
    "framework",
    "components"
  ],
  "properties": {
    "library": {
      "const": "react-kui"
    },
    "framework": {
      "const": "react"
    },
    "version": {
      "type": "string"
    },
    "components": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "props",
          "events",
          "nativeProps",
          "behavior",
          "examples"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "props": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/prop"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/prop"
            }
          },
          "nativeProps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "renderProps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "behavior": {
            "type": "object",
            "required": [
              "rules"
            ],
            "properties": {
              "rules": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "examples": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "title",
                "source"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "$defs": {
    "prop": {
      "type": "object",
      "required": [
        "name",
        "type",
        "required"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "boolean": {
          "type": "boolean"
        },
        "enumValues": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "defaultExpression": {
          "type": "string"
        },
        "descriptionZh": {
          "type": "string"
        },
        "descriptionEn": {
          "type": "string"
        }
      }
    }
  }
}
