{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/jsonpatch/latest.json",
  "title": "JSON schema for JSONPatch files",
  "x-lintel": {
    "source": "https://www.schemastore.org/json-patch.json",
    "sourceSha256": "bebaa582f954eb56843ba8ddd522cb12a243646d64f9e4c1a337323e6854a765",
    "fileMatch": [
      "*.patch",
      "*.patch.json",
      "*.patch.yml",
      "*.patch.yaml"
    ],
    "parsers": [
      "json",
      "yaml"
    ]
  },
  "type": "array",
  "items": {
    "oneOf": [
      {
        "properties": {
          "path": {
            "$ref": "#/$defs/path"
          },
          "op": {
            "description": "The operation to perform.",
            "type": "string",
            "enum": [
              "add",
              "replace",
              "test"
            ]
          },
          "value": {
            "description": "The value to add, replace or test."
          }
        },
        "required": [
          "value",
          "op",
          "path"
        ],
        "additionalProperties": false,
        "type": "object"
      },
      {
        "properties": {
          "path": {
            "$ref": "#/$defs/path"
          },
          "op": {
            "description": "The operation to perform.",
            "type": "string",
            "enum": [
              "remove"
            ]
          }
        },
        "required": [
          "op",
          "path"
        ],
        "additionalProperties": false,
        "type": "object"
      },
      {
        "properties": {
          "path": {
            "$ref": "#/$defs/path"
          },
          "op": {
            "description": "The operation to perform.",
            "type": "string",
            "enum": [
              "move",
              "copy"
            ]
          },
          "from": {
            "$ref": "#/$defs/path",
            "description": "A JSON Pointer path pointing to the location to move/copy from.",
            "pattern": "^#?(|(/([^/~]|~[01])*)*)$"
          }
        },
        "required": [
          "from",
          "op",
          "path"
        ],
        "additionalProperties": false,
        "type": "object"
      }
    ]
  },
  "$defs": {
    "path": {
      "description": "A JSON Pointer path.",
      "pattern": "^#?(|(/([^/~]|~[01])*)*)$",
      "type": "string"
    }
  },
  "id": "https://json.schemastore.org/json-patch.json"
}
