pub struct OpenApiUpstream { /* private fields */ }Expand description
An HTTP API whose OpenAPI operations become gateway tools
(McpGateway::openapi, 18.19.0): each call is an HTTP request to
base_url.
Implementations§
Source§impl OpenApiUpstream
impl OpenApiUpstream
Sourcepub fn new(
prefix: impl Into<String>,
spec: impl Into<String>,
base_url: impl Into<String>,
) -> Self
pub fn new( prefix: impl Into<String>, spec: impl Into<String>, base_url: impl Into<String>, ) -> Self
Tools <prefix>__<operation> from the OpenAPI document at spec
(an http(s):// URL or a file path), calling base_url (scheme,
host and optional path prefix: requests never go anywhere else).
Sourcepub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, name: impl Into<String>, value: impl Into<String>) -> Self
Send this header with every request (and the spec fetch): the API’s own credentials, never the caller’s.
Sourcepub fn include<I: IntoIterator<Item = S>, S: Into<String>>(self, ids: I) -> Self
pub fn include<I: IntoIterator<Item = S>, S: Into<String>>(self, ids: I) -> Self
operationIds to expose (default: every GET).
Sourcepub fn exclude<I: IntoIterator<Item = S>, S: Into<String>>(self, ids: I) -> Self
pub fn exclude<I: IntoIterator<Item = S>, S: Into<String>>(self, ids: I) -> Self
operationIds never to expose.
Sourcepub fn timeout_ms(self, timeout_ms: u64) -> Self
pub fn timeout_ms(self, timeout_ms: u64) -> Self
Give up on a request after this long (default 30 s).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenApiUpstream
impl RefUnwindSafe for OpenApiUpstream
impl Send for OpenApiUpstream
impl Sync for OpenApiUpstream
impl Unpin for OpenApiUpstream
impl UnsafeUnpin for OpenApiUpstream
impl UnwindSafe for OpenApiUpstream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more