{
    "$schema": "https://json-schema.org/draft/2019-09/schema",
    "$id": "https://json-schema.org/draft/2019-09/links",
    "title": "Link Description Object",
    "allOf": [
        { "required": [ "rel", "href" ] },
        { "$ref": "#/$defs/noRequiredFields" }
    ],
    "$defs": {
        "noRequiredFields": {
            "type": "object",
            "properties": {
                "anchor": {
                    "type": "string",
                    "format": "uri-template"
                },
                "anchorPointer": {
                    "type": "string",
                    "anyOf": [
                        { "format": "json-pointer" },
                        { "format": "relative-json-pointer" }
                    ]
                },
                "rel": {
                    "anyOf": [
                        { "type": "string" },
                        {
                            "type": "array",
                            "items": { "type": "string" },
                            "minItems": 1
                        }
                    ]
                },
                "href": {
                    "type": "string",
                    "format": "uri-template"
                },
                "hrefSchema": {
                    "$ref": "https://json-schema.org/draft/2019-09/hyper-schema",
                    "default": false
                },
                "templatePointers": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string",
                        "anyOf": [
                            { "format": "json-pointer" },
                            { "format": "relative-json-pointer" }
                        ]
                    }
                },
                "templateRequired": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "uniqueItems": true
                },
                "title": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "targetSchema": {
                    "$ref": "https://json-schema.org/draft/2019-09/hyper-schema",
                    "default": true
                },
                "targetMediaType": {
                    "type": "string"
                },
                "targetHints": { },
                "headerSchema": {
                    "$ref": "https://json-schema.org/draft/2019-09/hyper-schema",
                    "default": true
                },
                "submissionMediaType": {
                    "type": "string",
                    "default": "application/json"
                },
                "submissionSchema": {
                    "$ref": "https://json-schema.org/draft/2019-09/hyper-schema",
                    "default": true
                },
                "$comment": {
                    "type": "string"
                }
            }
        }
    }
}
