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>,
) -> OpenApiUpstream
pub fn new( prefix: impl Into<String>, spec: impl Into<String>, base_url: impl Into<String>, ) -> OpenApiUpstream
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>,
) -> OpenApiUpstream
pub fn header( self, name: impl Into<String>, value: impl Into<String>, ) -> OpenApiUpstream
Send this header with every request (and the spec fetch): the API’s own credentials, never the caller’s.
Sourcepub fn include<I, S>(self, ids: I) -> OpenApiUpstream
pub fn include<I, S>(self, ids: I) -> OpenApiUpstream
operationIds to expose (default: every GET).
Sourcepub fn exclude<I, S>(self, ids: I) -> OpenApiUpstream
pub fn exclude<I, S>(self, ids: I) -> OpenApiUpstream
operationIds never to expose.
Sourcepub fn timeout_ms(self, timeout_ms: u64) -> OpenApiUpstream
pub fn timeout_ms(self, timeout_ms: u64) -> OpenApiUpstream
Give up on a request after this long (default 30 s).
Trait Implementations§
Source§impl Clone for OpenApiUpstream
impl Clone for OpenApiUpstream
Source§fn clone(&self) -> OpenApiUpstream
fn clone(&self) -> OpenApiUpstream
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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