Crate openrpc_types

source ·
Expand description

A transcription of types from the OpenRPC Specification.

This library does NOT perform more complicated validation of the spec, including:

  • unique method names
  • unique error codes
  • reference idents

Link objects are not currently supported.

When quoted, the specification will appear as blockquoted text, like so.

Modules§

Structs§

  • A broken ReferenceOr::Reference was found.
  • 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. All the fixed fields declared above are objects that MUST use keys that match the regular expression: ^[a-zA-Z0-9.-_]+$
  • Contact information for the exposed API.
  • Defines an application level error.
  • The Example object is an object that defines an example that is intended to match the schema of a given Content Descriptor.In all cases, the example value is expected to be compatible with the type schema of its associated value. Tooling implementations MAY choose to validate compatibility automatically, and reject the example value(s) if incompatible.
  • 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.
  • Allows referencing an external resource for extended documentation.
  • The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.
  • License information for the exposed API.
  • Describes the interface for the given method name. The method name is used as the method field of the JSON-RPC body. It therefore MUST be unique.
  • 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.
  • An object representing a Server.
  • An object representing a Server Variable for server URL template substitution.
  • While the OpenRPC Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.The extensions properties are implemented as patterned fields that are always prefixed by “x-”.The extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).
  • Adds metadata to a single tag that is used by the Method Object. It is not mandatory to have a Tag Object per tag defined in the Method Object instances.

Enums§

  • The expected format of the parameters. As per the JSON-RPC 2.0 specification, the params of a JSON-RPC request object may be an array, object, or either (represented as by-position, by-name, and either respectively). When a method has a paramStructure value of by-name, callers of the method MUST send a JSON-RPC request object whose params field is an object. Further, the key names of the params object MUST be the same as the contentDescriptor.names for the given method. Defaults to “either”.

Constants§

Functions§