e.json-schema-validator.1.99.4.source-code.json-patch.json Maven / Gradle / Ivy
{
"title": "JSON Patch",
"description": "A JSON Schema describing a JSON Patch",
"$schema": "http://json-schema.org/draft-04/schema#",
"notes": [
"Defines a \"json-pointer\" format attribute",
"Only required members are accounted for, other members are ignored",
"FIXME: are zero-length patches allowed?"
],
"type": "array",
"items": {
"description": "one JSON Patch operation",
"allOf": [
{
"description": "Members common to all operations",
"type": "object",
"required": [ "op", "path" ],
"properties": {
"path": {
"type": "string",
"format": "json-pointer"
}
}
},
{ "$ref": "#/definitions/oneOperation" }
]
},
"definitions": {
"add": {
"description": "add operation. Value can be any JSON value.",
"properties": { "op": { "enum": [ "add" ] } },
"required": [ "value" ]
},
"remove": {
"description": "remove operation. Only a path is specified.",
"properties": { "op": { "enum": [ "remove" ] } }
},
"replace": {
"description": "replace operation. Value can be any JSON value.",
"properties": { "op": { "enum": [ "replace" ] } },
"required": [ "value" ]
},
"move": {
"description": "move operation. \"from\" is a JSON Pointer.",
"properties": {
"op": { "enum": [ "move" ] },
"from": { "type": "string", "format": "json-pointer" }
},
"required": [ "from" ]
},
"copy": {
"description": "copy operation. \"from\" is a JSON Pointer.",
"properties": {
"op": { "enum": [ "copy" ] },
"from": { "type": "string", "format": "json-pointer" }
},
"required": [ "from" ]
},
"test": {
"description": "test operation. Value can be any JSON value.",
"properties": { "op": { "enum": [ "test" ] } },
"required": [ "value" ]
},
"oneOperation": {
"oneOf": [
{ "$ref": "#/definitions/add" },
{ "$ref": "#/definitions/remove" },
{ "$ref": "#/definitions/replace" },
{ "$ref": "#/definitions/move" },
{ "$ref": "#/definitions/copy" },
{ "$ref": "#/definitions/test" }
]
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy