{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tmp.innovacionsantiago.cl/style-v10/schemas/components.v1.json",
  "title": "Catálogo de componentes Style v10",
  "type": "object",
  "required": [
    "schema",
    "version",
    "coverage",
    "components"
  ],
  "properties": {
    "schema": {
      "const": "cis.style.components.v1"
    },
    "version": {
      "type": "string"
    },
    "coverage": {
      "type": "object",
      "required": [
        "component_count",
        "category_count",
        "examples_per_component",
        "observed_component_count",
        "proposed_component_count"
      ],
      "properties": {
        "component_count": {
          "type": "integer",
          "minimum": 1
        },
        "category_count": {
          "type": "integer",
          "minimum": 1
        },
        "examples_per_component": {
          "type": "integer",
          "minimum": 2
        },
        "observed_component_count": {
          "type": "integer",
          "minimum": 0
        },
        "proposed_component_count": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "components": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "category",
          "summary",
          "status",
          "owner",
          "variants",
          "guidance",
          "consumers",
          "dependencies",
          "states",
          "accessibility",
          "adoption_evidence",
          "examples",
          "code"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "category": {
            "type": "string",
            "minLength": 1
          },
          "summary": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "enum": [
              "candidato",
              "estable",
              "deprecado"
            ]
          },
          "owner": {
            "type": "object",
            "required": [
              "repository",
              "steward",
              "scope"
            ],
            "properties": {
              "repository": {
                "const": "core/core-style"
              },
              "steward": {
                "type": "string",
                "minLength": 1
              },
              "scope": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          "variants": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "required": [
                "brand",
                "site",
                "theme"
              ],
              "properties": {
                "brand": {
                  "type": "string"
                },
                "site": {
                  "type": "string"
                },
                "theme": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "guidance": {
            "type": "object",
            "required": [
              "do",
              "dont"
            ],
            "properties": {
              "do": {
                "type": "array",
                "minItems": 2,
                "items": {
                  "type": "string"
                }
              },
              "dont": {
                "type": "array",
                "minItems": 2,
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "consumers": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "dependencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "accessibility": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "adoption_evidence": {
            "type": "object",
            "required": [
              "classification",
              "implementation_count",
              "repository_count",
              "repositories",
              "snapshot",
              "generated_at"
            ],
            "properties": {
              "classification": {
                "enum": [
                  "observado",
                  "propuesto"
                ]
              },
              "implementation_count": {
                "type": "integer",
                "minimum": 0
              },
              "repository_count": {
                "type": "integer",
                "minimum": 0
              },
              "repositories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "snapshot": {
                "type": "string"
              },
              "generated_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "examples": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "brand",
                "site",
                "theme",
                "description",
                "html"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "brand": {
                  "type": "string"
                },
                "site": {
                  "type": "string"
                },
                "theme": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "html": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "code": {
            "type": "object",
            "required": [
              "html"
            ],
            "properties": {
              "html": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
