{
  "$import": {
    "openapi": "file:///openapi.json"
  },
  "definitions": {
    "OpenRPC": {
      "description": "This is the root object of the OpenRPC document. The contents of this object represent a whole OpenRPC document. How this object is constructed or stored is outside the scope of the OpenRPC Specification.",
      "type": "object",
      "properties": {
        "openrpc": {
          "type": "string",
          "const": "3.0.0"
        },
        "info": {
          "$ref": "openapi:Info"
        },
        "servers": {
          "type": "array",
          "items": {
            "$ref": "openapi:Server"
          }
        },
        "methods": {
          "type": "array",
          "items": {
            "$ref": "Method"
          }
        },
        "components": {
          "$ref": "Components"
        },
        "externalDocs": {
          "$ref": "openapi:ExternalDocs"
        }
      },
      "required": [
        "openrpc",
        "info",
        "methods"
      ]
    },
    "Method": {
      "description": "Describes a single API operation on a path.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "tags": {
          "type": "array",
          "items": {
            "$ref": "openapi:Tag"
          }
        },
        "summary": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "externalDocs": {
          "$ref": "openapi:ExternalDocs"
        },
        "params": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "ContentDescriptor"
              },
              {
                "$ref": "openapi:Reference"
              }
            ]
          }
        },
        "result": {
          "oneOf": [
            {
              "$ref": "ContentDescriptor"
            },
            {
              "$ref": "openapi:Reference"
            }
          ]
        },
        "deprecated": {
          "type": "boolean"
        },
        "servers": {
          "type": "array",
          "items": {
            "$ref": "openapi:Server"
          }
        },
        "errors": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "Error"
              },
              {
                "$ref": "openapi:Reference"
              }
            ]
          }
        },
        "links": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "$ref": "Link"
              },
              {
                "$ref": "openapi:Reference"
              }
            ]
          }
        },
        "paramStructure": {
          "type": "string",
          "enum": [
            "by-name",
            "by-position",
            "either"
          ],
          "default": "by-name"
        },
        "examples": {
          "type": "array",
          "items": {
            "$ref": "ExamplePairingObject"
          }
        }
      },
      "required": [
        "name",
        "params",
        "result"
      ]
    },
    "Components": {
      "description": "Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.",
      "type": "object",
      "properties": {
        "contentDescriptors": {
          "$ref": "ContentDescriptors"
        },
        "schemas": {
          "$ref": "openapi:Schemas"
        },
        "examples": {
          "$ref": "openapi:Examples"
        },
        "links": {
          "$ref": "Links"
        },
        "errors": {
          "$ref": "Errors"
        },
        "examplePairingObjects": {
          "$ref": "ExamplePairingObjects"
        },
        "tags": {
          "$ref": "Tags"
        }
      }
    },
    "ContentDescriptors": {
      "type": "object",
      "additionalProperties": {
        "$ref": "ContentDescriptor"
      }
    },
    "ContentDescriptor": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "required": {
          "type": "boolean"
        },
        "schema": {
          "type": "any"
        },
        "deprecated": {
          "type": "boolean"
        }
      },
      "required": [
        "name",
        "schema"
      ]
    },
    "Links": {
      "type": "object",
      "additionalProperties": {
        "$ref": "Link"
      }
    },
    "Link": {
      "description": "The Link object represents a possible design-time link for a result. The presence of a link does not guarantee the caller’s ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between results and other methods.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "params": {
          "$ref": "Params"
        },
        "server": {
          "$ref": "openapi:Server"
        }
      }
    },
    "Params": {
      "type": "object",
      "additionalProperties": {
        "type": "any"
      }
    },
    "Errors": {
      "type": "object",
      "additionalProperties": {
        "$ref": "Error"
      }
    },
    "Error": {
      "description": "Defines an application level error.",
      "type": "object",
      "properties": {
        "code": {
          "type": "integer"
        },
        "message": {
          "type": "string"
        },
        "data": {
          "type": "any"
        }
      },
      "required": [
        "code",
        "message"
      ]
    },
    "ExamplePairingObjects": {
      "type": "object",
      "additionalProperties": {
        "$ref": "ExamplePairingObject"
      }
    },
    "ExamplePairingObject": {
      "description": "The example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "params": {
          "type": "array",
          "items": {
            "$ref": "ExampleObject"
          }
        },
        "result": {
          "$ref": "ExampleObject"
        }
      }
    },
    "ExampleObject": {
      "description": "The Example object is an object the defines an example that is intended to match a given Content Descriptor Schema.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "value": {
          "type": "any"
        },
        "externalValue": {
          "type": "string"
        }
      }
    },
    "Tags": {
      "type": "object",
      "additionalProperties": {
        "$ref": "openapi:Tag"
      }
    }
  },
  "$ref": "OpenRPC"
}
