{
	"title": "JSON schema for JSONPatch files",
	"$schema": "http://json-schema.org/draft-04/schema#",

	"type": "array",

	"items": {
		"$ref": "#/definitions/operation"
	},

	"definitions": {
		"operation": {
			"type": "object",
			"required": [ "op", "path" ],
			"allOf": [ { "$ref": "#/definitions/path" } ],
			"oneOf": [
				{
					"required": [ "value" ],
					"properties": {
						"op": {
							"description": "The operation to perform.",
							"type": "string",
							"enum": [ "add", "replace", "test" ]
						},
						"value": {
							"description": "The value to add, replace or test."
						}
					}
				},
				{
					"properties": {
						"op": {
							"description": "The operation to perform.",
							"type": "string",
							"enum": [ "remove" ]
						}
					}
				},
				{
					"required": [ "from" ],
					"properties": {
						"op": {
							"description": "The operation to perform.",
							"type": "string",
							"enum": [ "move", "copy" ]
						},
						"from": {
							"description": "A JSON Pointer path pointing to the location to move/copy from.",
							"type": "string"
						}
					}
				}
			]
		},
		"path": {
			"properties": {
				"path": {
					"description": "A JSON Pointer path.",
					"type": "string"
				}
			}
		}
	}
}
