JSON · Schema

JSON Patch and JSON Merge Patch

Schema describing JSON Patch (RFC 6902) operations for modifying JSON documents, and JSON Merge Patch (RFC 7396) for merging partial updates into JSON documents.

Data FormatSerializationWeb DevelopmentJSONRFC 8259
View JSON Schema on GitHub

JSON Schema

json-patch.json Raw ↑
{
  "$id": "json-patch.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "JSON Patch and JSON Merge Patch",
  "description": "Schema describing JSON Patch (RFC 6902) operations for modifying JSON documents, and JSON Merge Patch (RFC 7396) for merging partial updates into JSON documents.",
  "oneOf": [
    {
      "$ref": "#/$defs/jsonPatch"
    },
    {
      "$ref": "#/$defs/jsonMergePatch"
    }
  ],
  "$defs": {
    "jsonPatch": {
      "title": "JSON Patch (RFC 6902)",
      "description": "A JSON Patch document is a JSON document that represents an array of operations to apply to a target JSON document.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/operation"
      },
      "minItems": 1
    },
    "operation": {
      "type": "object",
      "description": "A single JSON Patch operation.",
      "required": [
        "op",
        "path"
      ],
      "properties": {
        "op": {
          "type": "string",
          "description": "The operation to perform.",
          "enum": [
            "add",
            "remove",
            "replace",
            "move",
            "copy",
            "test"
          ]
        },
        "path": {
          "type": "string",
          "description": "A JSON Pointer (RFC 6901) string identifying the target location within the document.",
          "examples": [
            "/foo/bar",
            "/items/0",
            "/~0escaped~1path"
          ]
        },
        "value": {
          "description": "The value to use for add, replace, or test operations."
        },
        "from": {
          "type": "string",
          "description": "A JSON Pointer string identifying the source location for move or copy operations.",
          "examples": [
            "/foo/bar"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "op": {
                "enum": ["add", "replace", "test"]
              }
            }
          },
          "then": {
            "required": ["value"]
          }
        },
        {
          "if": {
            "properties": {
              "op": {
                "enum": ["move", "copy"]
              }
            }
          },
          "then": {
            "required": ["from"]
          }
        }
      ],
      "additionalProperties": false
    },
    "jsonMergePatch": {
      "title": "JSON Merge Patch (RFC 7396)",
      "description": "A JSON Merge Patch document describes changes to a target JSON document using a syntax that closely mirrors the document being modified. Recipients process merge patches by comparing the content with the current target document: members present in the patch replace the corresponding target values, null values remove the corresponding target members, and members not present in the patch remain unchanged.",
      "oneOf": [
        {
          "type": "object",
          "description": "An object whose members represent changes to apply. A null value removes the member; an object value is applied recursively; any other value replaces the target member.",
          "additionalProperties": true
        },
        {
          "type": "array",
          "description": "When the merge patch is not an object, the entire target is replaced."
        },
        {
          "type": "string",
          "description": "When the merge patch is not an object, the entire target is replaced."
        },
        {
          "type": "number",
          "description": "When the merge patch is not an object, the entire target is replaced."
        },
        {
          "type": "boolean",
          "description": "When the merge patch is not an object, the entire target is replaced."
        },
        {
          "type": "null",
          "description": "A null merge patch replaces the entire target with null."
        }
      ]
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/json-patch"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.