HAL

{
  "type": "object",
  "properties": {
    "_links": { "$ref": "#/definitions/links" },
    "_embedded": { "$ref": "#/definitions/embedded" }
  },
  "definitions": {
    "links": { 
      "title": "HAL Links",
      "description": "Object of links with the rels as the keys",
      "type": "object",
      "additionalProperties": {
        "oneOf": [ 
          { "$ref": "#/definitions/linkObject" }, 
          { "$ref": "#/definitions/linkArray" }
        ]
      }
    },
    "linkArray": { 
      "title": "HAL Link Array",
      "description": "An array of linkObjects of the same link relation",
      "type": "array",
      "items": { "$ref": "#/definitions/linkObject" }
    },
    "linkObject": {
      "title": "HAL Link Object",
      "description": "An object with link information",
      "type": "object",
      "properties": {
        "name": { "$ref": "https://hyperschema.org/core/base#/definitions/name" },
        "href": {
          "anyOf": [
            { "$ref": "https://hyperschema.org/core/link#/definitions/href" },
            { "$ref": "https://hyperschema.org/core/link#/definitions/hrefTemplated" }
          ]
        },
        "templated": { "$ref": "https://hyperschema.org/core/link#/definitions/isTemplated" },
        "type": { "$ref": "https://hyperschema.org/core/base#/definitions/mediaType" },
        "deprecation": { "$ref": "https://hyperschema.org/core/link#/definitions/isDeprecated" }
      },
      "required": [ "href" ]
    },
    "embedded": {
      "title": "HAL Embedded Resource",
      "description": "An embedded HAL resource",
      "type": "object",
      "additionalProperties": {
        "oneOf": [
          { "$ref": "#" }, 
          { "$ref": "#/definitions/embeddedArray" }
        ]
      }
    },
    "embeddedArray": {
      "title": "HAL Embedded Array",
      "description": "An array of embedded resources with the same link relation",
      "type": "array",
      "items": { "$ref": "#" }
    }
  }
}