{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/collate/json-schema/collate-create-chart-schema.json",
  "title": "CreateChart",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/collate-charts-api-openapi.yml#/components/schemas/CreateChart",
  "required": [
    "name",
    "service"
  ],
  "type": "object",
  "properties": {
    "name": {
      "maxLength": 256,
      "minLength": 1,
      "pattern": "^((?!::)[^>\"\\x00-\\x1f])*$",
      "type": "string"
    },
    "displayName": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "chartType": {
      "type": "string",
      "enum": [
        "Line",
        "Table",
        "Bar",
        "Area",
        "Pie",
        "Histogram",
        "Scatter",
        "Text",
        "BoxPlot",
        "SanKey",
        "Gauge",
        "Map",
        "Graph",
        "Heatmap",
        "Timeline",
        "Other"
      ]
    },
    "sourceUrl": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TagLabel"
      }
    },
    "owners": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    },
    "service": {
      "maxLength": 3072,
      "minLength": 1,
      "type": "string"
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "dataProducts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "lifeCycle": {
      "$ref": "#/$defs/LifeCycle"
    },
    "sourceHash": {
      "maxLength": 32,
      "minLength": 1,
      "type": "string"
    },
    "extension": {
      "type": "object"
    },
    "dashboards": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "reviewers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityReference"
      }
    }
  },
  "$defs": {
    "AccessDetails": {
      "required": [
        "timestamp"
      ],
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "integer",
          "format": "int64"
        },
        "accessedBy": {
          "$ref": "#/$defs/EntityReference"
        },
        "accessedByAProcess": {
          "type": "string"
        }
      }
    },
    "CoverImage": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "position": {
          "type": "string"
        }
      }
    },
    "EntityReference": {
      "required": [
        "id",
        "type"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "type": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "fullyQualifiedName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "deleted": {
          "type": "boolean"
        },
        "inherited": {
          "type": "boolean"
        },
        "href": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "LifeCycle": {
      "type": "object",
      "properties": {
        "created": {
          "$ref": "#/$defs/AccessDetails"
        },
        "updated": {
          "$ref": "#/$defs/AccessDetails"
        },
        "accessed": {
          "$ref": "#/$defs/AccessDetails"
        }
      }
    },
    "PatternMatch": {
      "required": [
        "name",
        "score"
      ],
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "regex": {
          "type": "string"
        },
        "score": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "Style": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string"
        },
        "iconURL": {
          "type": "string"
        },
        "coverImage": {
          "$ref": "#/$defs/CoverImage"
        }
      }
    },
    "TagLabel": {
      "required": [
        "labelType",
        "source",
        "state",
        "tagFQN"
      ],
      "type": "object",
      "properties": {
        "tagFQN": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "style": {
          "$ref": "#/$defs/Style"
        },
        "source": {
          "type": "string",
          "enum": [
            "Classification",
            "Glossary"
          ]
        },
        "labelType": {
          "type": "string",
          "enum": [
            "Manual",
            "Propagated",
            "Automated",
            "Derived",
            "Generated"
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "Suggested",
            "Confirmed"
          ]
        },
        "href": {
          "type": "string",
          "format": "uri"
        },
        "reason": {
          "type": "string"
        },
        "appliedAt": {
          "type": "string",
          "format": "date-time"
        },
        "appliedBy": {
          "type": "string"
        },
        "metadata": {
          "$ref": "#/$defs/TagLabelMetadata"
        }
      }
    },
    "TagLabelMetadata": {
      "type": "object",
      "properties": {
        "recognizer": {
          "$ref": "#/$defs/TagLabelRecognizerMetadata"
        },
        "expiryDate": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "TagLabelRecognizerMetadata": {
      "required": [
        "recognizerId",
        "recognizerName",
        "score"
      ],
      "type": "object",
      "properties": {
        "recognizerId": {
          "type": "string",
          "format": "uuid"
        },
        "recognizerName": {
          "type": "string"
        },
        "score": {
          "type": "number",
          "format": "double"
        },
        "target": {
          "type": "string",
          "enum": [
            "content",
            "column_name"
          ]
        },
        "patterns": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PatternMatch"
          }
        }
      }
    }
  }
}