{
  "$defs": {
    "PatchBaseHashV1": {
      "description": "Explicit hash kinds prevent applying source patches to a compiled artifact.",
      "oneOf": [
        {
          "properties": {
            "hash": {
              "type": "string"
            },
            "kind": {
              "const": "source",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "hash"
          ],
          "type": "object"
        },
        {
          "properties": {
            "hash": {
              "type": "string"
            },
            "kind": {
              "const": "artifact",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "hash"
          ],
          "type": "object"
        },
        {
          "properties": {
            "hash": {
              "type": "string"
            },
            "kind": {
              "const": "render",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "hash"
          ],
          "type": "object"
        }
      ]
    },
    "PatchOperationV1": {
      "oneOf": [
        {
          "properties": {
            "op": {
              "const": "add",
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "value": true
          },
          "required": [
            "op",
            "path",
            "value"
          ],
          "type": "object"
        },
        {
          "properties": {
            "op": {
              "const": "remove",
              "type": "string"
            },
            "path": {
              "type": "string"
            }
          },
          "required": [
            "op",
            "path"
          ],
          "type": "object"
        },
        {
          "properties": {
            "op": {
              "const": "replace",
              "type": "string"
            },
            "path": {
              "type": "string"
            },
            "value": true
          },
          "required": [
            "op",
            "path",
            "value"
          ],
          "type": "object"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "author": {
      "type": [
        "string",
        "null"
      ]
    },
    "base_hash": {
      "$ref": "#/$defs/PatchBaseHashV1"
    },
    "operations": {
      "items": {
        "$ref": "#/$defs/PatchOperationV1"
      },
      "type": "array"
    },
    "schema_version": {
      "type": "string"
    }
  },
  "required": [
    "schema_version",
    "base_hash",
    "operations"
  ],
  "title": "DiagramPatchV1",
  "type": "object"
}
