{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "BindingHTTP": {
      "properties": {
        "prefix": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "prefix"
      ]
    },
    "BindingWS": {
      "properties": {
        "path": {
          "type": "string"
        },
        "subprotocol": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "path",
        "subprotocol"
      ]
    },
    "Bindings": {
      "properties": {
        "primary": {
          "type": "string"
        },
        "http": {
          "oneOf": [
            {
              "$ref": "#/$defs/BindingHTTP"
            },
            {
              "type": "null"
            }
          ]
        },
        "ws": {
          "oneOf": [
            {
              "$ref": "#/$defs/BindingWS"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "primary"
      ]
    },
    "Build": {
      "properties": {
        "revision": {
          "type": "string"
        },
        "dirty": {
          "type": "boolean"
        },
        "go": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "revision",
        "dirty",
        "go"
      ]
    },
    "HTTPBinding": {
      "properties": {
        "method": {
          "type": "string"
        },
        "path": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "method",
        "path"
      ]
    },
    "Identity": {
      "properties": {
        "root_id": {
          "type": "string"
        },
        "world_space_id": {
          "type": "string"
        },
        "journal_instance_id": {
          "type": "string"
        },
        "world": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "root_id",
        "world_space_id",
        "journal_instance_id"
      ]
    },
    "Operation": {
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "grant": {
          "type": "string"
        },
        "doc": {
          "type": "string"
        },
        "params": {
          "items": {
            "$ref": "#/$defs/Param"
          },
          "type": "array"
        },
        "request": {
          "type": "string"
        },
        "response": {
          "type": "string"
        },
        "errors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "http": {
          "$ref": "#/$defs/HTTPBinding"
        },
        "ws": {
          "type": "boolean"
        }
      },
      "type": "object",
      "required": [
        "name",
        "kind",
        "doc",
        "params",
        "errors",
        "ws"
      ]
    },
    "Param": {
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "doc": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "name",
        "kind",
        "required",
        "doc"
      ]
    },
    "Refusal": {
      "properties": {
        "name": {
          "type": "string"
        },
        "http": {
          "type": "integer"
        },
        "meaning": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "name",
        "http",
        "meaning"
      ]
    }
  },
  "properties": {
    "service": {
      "type": "string"
    },
    "surface": {
      "type": "string"
    },
    "contract": {
      "type": "string"
    },
    "build": {
      "$ref": "#/$defs/Build"
    },
    "identity": {
      "oneOf": [
        {
          "$ref": "#/$defs/Identity"
        },
        {
          "type": "null"
        }
      ]
    },
    "bindings": {
      "$ref": "#/$defs/Bindings"
    },
    "operations": {
      "items": {
        "$ref": "#/$defs/Operation"
      },
      "type": "array"
    },
    "refusals": {
      "items": {
        "$ref": "#/$defs/Refusal"
      },
      "type": "array"
    },
    "files": {
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "type": "object",
  "required": [
    "service",
    "surface",
    "contract",
    "build",
    "bindings",
    "operations",
    "refusals",
    "files"
  ],
  "title": "Describe"
}
