pub struct OpenApiToolset { /* private fields */ }Expand description
The operations of one OpenAPI document as a Toolset named openapi_toolset: one tool
per operation, in document order.
Each tool’s declaration lists the operation’s path, query and header parameters and, for an
application/json request body, body. A call returns {"status": <u16>, "body": <body>}
for any HTTP status, plus "truncated": true when the body was cut. Redirects are not
followed: a 3xx response is returned as a result like any other status.
Implementations§
Source§impl OpenApiToolset
impl OpenApiToolset
Sourcepub fn new(spec: &OpenApiSpec, config: OpenApiConfig) -> Result<Self, Error>
pub fn new(spec: &OpenApiSpec, config: OpenApiConfig) -> Result<Self, Error>
Builds every tool of spec once.
Fails with Error::DuplicateName when two operations (or two properties of one tool)
share a name, Error::NameTooLong when a prefixed name is over 64 bytes,
Error::Ref for a $ref that cannot be resolved, Error::NoBaseUrl when there
is no absolute base URL (or it has a query or fragment), and Error::HttpClient when
the HTTP client cannot be built.
Sourcepub fn skipped_operations(&self) -> &[SkippedOperation]
pub fn skipped_operations(&self) -> &[SkippedOperation]
The operations that did not become tools, and why.
Trait Implementations§
Source§impl Debug for OpenApiToolset
impl Debug for OpenApiToolset
Source§impl Toolset for OpenApiToolset
impl Toolset for OpenApiToolset
Source§fn tools<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ReadonlyContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn Tool>>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn tools<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ReadonlyContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn Tool>>, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The tools in document order, filtered by tool_filter (which sees the unprefixed
names), then renamed <prefix>_<name> when prefix is set.