{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:web-component-contract:profile:1",
  "title": "Web Component contract schema profile version 1",
  "type": "object",
  "required": [
    "$schema",
    "profile",
    "profileVersion",
    "type",
    "tagName",
    "properties",
    "additionalProperties"
  ],
  "properties": {
    "$schema": {
      "const": "https://json-schema.org/draft/2020-12/schema"
    },
    "profile": {
      "const": "web-component-contract/schema"
    },
    "profileVersion": {
      "const": 1
    },
    "type": {
      "const": "object"
    },
    "tagName": {
      "type": "string",
      "pattern": "^[a-z][.0-9_a-z-]*-[.0-9_a-z-]*$"
    },
    "properties": {
      "type": "object",
      "required": [
        "attributes",
        "properties",
        "events",
        "slots",
        "cssProperties",
        "cssParts"
      ],
      "properties": {
        "attributes": { "$ref": "#/$defs/interfaceSection" },
        "properties": { "$ref": "#/$defs/interfaceSection" },
        "events": { "$ref": "#/$defs/interfaceSection" },
        "slots": { "$ref": "#/$defs/interfaceSection" },
        "cssProperties": { "$ref": "#/$defs/interfaceSection" },
        "cssParts": { "$ref": "#/$defs/interfaceSection" }
      },
      "additionalProperties": false
    },
    "required": {
      "type": "array",
      "items": {
        "enum": ["attributes", "properties", "cssProperties", "slots"]
      },
      "uniqueItems": true
    },
    "additionalProperties": {
      "const": false
    },
    "$defs": {
      "type": "object"
    },
    "$id": { "type": "string" },
    "title": { "type": "string" },
    "description": { "type": "string" }
  },
  "$defs": {
    "interfaceSection": {
      "type": "object",
      "required": ["type", "properties", "additionalProperties"],
      "properties": {
        "type": { "const": "object" },
        "properties": { "type": "object" },
        "required": {
          "type": "array",
          "items": { "type": "string" },
          "uniqueItems": true
        },
        "additionalProperties": { "const": false },
        "title": { "type": "string" },
        "description": { "type": "string" },
        "$defs": { "type": "object" }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
