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§
- resolved
- Parallel types where
ReferenceOr<T>
is replaced by itemT
.
Structs§
- Broken
Reference - A broken
ReferenceOr::Reference
was found. - Components
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
Contact information for the exposed API.
- Content
Descriptor - Error
Defines an application level error.
- Example
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.
- Example
Pairing 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.
- External
Documentation Allows referencing an external resource for extended documentation.
- Info
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
License information for the exposed API.
- Method
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.
- OpenRPC
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.
- Server
An object representing a Server.
- Server
Variable An object representing a Server Variable for server URL template substitution.
- Specification
Extensions 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).
- Tag
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§
- Example
Value - Param
Structure 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”.
- Reference
Or
Constants§
- OPEN_
RPC_ SPECIFICATION_ VERSION - The version of the OpenRPC specification that this library was written against.
Functions§
- resolve_
within - Try and resolve all
ReferenceOr
s in the document by looking up references inOpenRPC::components
.