pub struct Method {Show 13 fields
pub name: String,
pub tags: Vec<RefOr<Tag>>,
pub summary: Option<String>,
pub description: Option<String>,
pub external_docs: Option<ExternalDocumentation>,
pub params: Vec<RefOr<ContentDescriptor>>,
pub result: Option<RefOr<ContentDescriptor>>,
pub deprecated: bool,
pub servers: Option<Vec<Server>>,
pub errors: Vec<RefOr<Error>>,
pub links: Vec<RefOr<Link>>,
pub param_structure: ParamStructure,
pub examples: Vec<RefOr<ExamplePairing>>,
}
Expand description
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.
Fields§
§name: String
The cannonical name of the method.
This name must be unique within the methods array.
A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier.
summary: Option<String>
A short summary of what the method does.
description: Option<String>
A verbose explanation of the method behavior.
GitHub Flavored Markdown syntax may be used for rich text representation.
external_docs: Option<ExternalDocumentation>
Additional external documentation for this method.
params: Vec<RefOr<ContentDescriptor>>
A list of parameters that are applicable for this method.
The list must not include duplicated parameters and therefore require name
to be
unique.
All required parameters must be listed before any optional parameters.
result: Option<RefOr<ContentDescriptor>>
The description of the result returned by the method.
If defined, it must be a ContentDescriptor
or a [Reference
].
If undefined, the method must only be used as a notification.
deprecated: bool
Declares this method as deprecated.
Consumers should refrain from usage of the declared method.
The default value is false
.
servers: Option<Vec<Server>>
An alternative servers
array to service this method.
If specified, it overrides the servers
array defined at the root level.
errors: Vec<RefOr<Error>>
A list of custom application-defined errors that may be returned.
The errors must have unique error codes.
links: Vec<RefOr<Link>>
A list of possible links from this method call.
param_structure: ParamStructure
The expected format of the parameters.
The parameters of a method may be an array, an object, or either. When a method
has a param_structure
value of ByName
, callers of the method must pass an
object as the parameters. When a method has a param_structure
value of ByPosition
,
callers of the method must pass an array as the parameters. Otherwise, callers may
pass either an array or an object as the parameters.
The default value is Either
.
examples: Vec<RefOr<ExamplePairing>>
An array of ExamplePairing
objects, where each example includes a valid
params-to-result ContentDescriptor
pairing.