All Downloads are FREE. Search and download functionalities are using the official Maven repository.

e.json-schema-validator.1.99.4.source-code.hyper-schema-with-json-patch.json Maven / Gradle / Ivy

{
    "patch": {
        "source": {
            "$ref": "http://json-schema.org/draft-04/schema#"
        },
        "with": [
            {
                "explanation": [
                    "Remember that extra members in JSON Patch are ignored, so we can inline explanations",
                    "Start by replacing metadata information.",
                    "Note that replacing FAILS if the pointer fails to resolve."
                ],
                "op": "replace",
                "path": "/id",
                "value": "http://json-schema.org/draft-04/hyper-schema#"
            },
            {
                "explanation": [ "Also replace the description" ],
                "op": "replace",
                "path": "/description",
                "value": "JSON Schema hyperschema"
            },
            {
                "explanation": [
                    "And finally, add the title.",
                    "Note that if the member already exists, it is replaced."
                ],
                "op": "add",
                "path": "/title",
                "value": "JSON Hyper-schema"
            },
            {
                "explanation": [
                    "Add definition for an LDO."
                ],
                "op": "add",
                "path": "/definitions/linkDescription",
                "value": {
                    "title": "Link Description Object",
                    "type": "object",
                    "required": [ "href", "rel" ],
                    "properties": {
                        "href": {
                            "description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
                            "type": "string"
                        },
                        "rel": {
                            "description": "relation to the target resource of the link",
                            "type": "string"
                        },
                        "title": {
                            "description": "a title for the link",
                            "type": "string"
                        },
                        "targetSchema": {
                            "description": "JSON Schema describing the link target",
                            "$ref": "#"
                        },
                        "mediaType": {
                            "description": "media type (as defined by RFC 2046) describing the link target",
                            "type": "string"
                        },
                        "method": {
                            "description": "method for requesting the target of the link (e.g. for HTTP this might be \"GET\" or \"DELETE\")",
                            "type": "string"
                        },
                        "encType": {
                            "description": "The media type in which to submit data along with the request",
                            "type": "string",
                            "default": "application/json"
                        },
                        "schema": {
                            "description": "Schema describing the data to submit along with the request",
                            "$ref": "#"
                        }
                    }
                }
            },
            {
                "explanation": [
                    "Add the links member to properties"
                ],
                "op": "add",
                "path": "/properties/links",
                "value": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/linkDescription"
                    }
                }
            },
            {
                "explanation": [
                    "Add the fragmentResolution member to properties"
                ],
                "op": "add",
                "path": "/properties/fragmentResolution",
                "value": {
                    "type": "string"
                }
            },
            {
                "explanation": [
                    "Add the media member to properties"
                ],
                "op": "add",
                "path": "/properties/media",
                "value": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "description": "A media type, as described in RFC 2046",
                            "type": "string"
                        },
                        "binaryEncoding": {
                            "description": "A content encoding scheme, as described in RFC 2045",
                            "type": "string"
                        }
                    }
                }
            },
            {
                "explanation": [
                    "Add the pathStart member to properties"
                ],
                "op": "add",
                "path": "/properties/pathStart",
                "value": {
                    "description": "Instances' URIs must start with this value for this schema to apply to them",
                    "type": "string",
                    "format": "uri"
                }
            }
        ]
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy