{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "BindingHTTP": {
      "properties": {
        "prefix": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "prefix"
      ],
      "description": "BindingHTTP describes the HTTP binding in the describe document."
    },
    "BindingWS": {
      "properties": {
        "path": {
          "type": "string"
        },
        "subprotocol": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "path",
        "subprotocol"
      ],
      "description": "BindingWS describes the socket binding."
    },
    "Bindings": {
      "properties": {
        "primary": {
          "type": "string"
        },
        "http": {
          "oneOf": [
            {
              "$ref": "#/$defs/BindingHTTP"
            },
            {
              "type": "null"
            }
          ]
        },
        "ws": {
          "oneOf": [
            {
              "$ref": "#/$defs/BindingWS"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "primary"
      ],
      "description": "Bindings names the primary binding and describes each offered one."
    },
    "Build": {
      "properties": {
        "revision": {
          "type": "string"
        },
        "dirty": {
          "type": "boolean"
        },
        "go": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "revision",
        "dirty",
        "go"
      ],
      "description": "Build identifies the binary."
    },
    "HTTPBinding": {
      "properties": {
        "method": {
          "type": "string"
        },
        "path": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "method",
        "path"
      ],
      "description": "HTTPBinding carries an operation as one request and one response."
    },
    "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"
      ],
      "description": "Identity is the service-specific identity member: the Journal root the world lives in, the world's own space, the Journal instance and the world's name, the space its grants are placed in."
    },
    "Operation": {
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "description": "mutation | read | stream | session | operational: the standard's operation kind"
        },
        "grant": {
          "type": "string",
          "description": "read | publish | declare | provision: the grant kind the operation needs; empty for operational rows"
        },
        "doc": {
          "type": "string"
        },
        "params": {
          "items": {
            "$ref": "#/$defs/Param"
          },
          "type": "array"
        },
        "request": {
          "type": "string",
          "description": "body type; \"bytes\" for a raw stream"
        },
        "response": {
          "type": "string",
          "description": "result type; \"bytes\" for a raw stream; empty for a served file"
        },
        "errors": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "description": "refusals beyond invalid, unverified and denied"
        },
        "http": {
          "$ref": "#/$defs/HTTPBinding"
        },
        "ws": {
          "type": "boolean",
          "description": "carried by the socket as a message of the same name; streams and operational rows are HTTP only"
        }
      },
      "type": "object",
      "required": [
        "name",
        "kind",
        "doc",
        "params",
        "errors",
        "ws"
      ],
      "description": "Operation is one row of the table."
    },
    "Param": {
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "doc": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "name",
        "kind",
        "required",
        "doc"
      ],
      "description": "Param is one named input of an operation, outside its body."
    },
    "Refusal": {
      "properties": {
        "name": {
          "type": "string"
        },
        "http": {
          "type": "integer"
        },
        "meaning": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "name",
        "http",
        "meaning"
      ],
      "description": "Refusal is one row of the refusal table."
    }
  },
  "properties": {
    "service": {
      "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",
    "contract",
    "build",
    "bindings",
    "operations",
    "refusals",
    "files"
  ],
  "title": "Describe",
  "description": "Describe is the document of GET /describe."
}
