pub struct OpenApiSpec {
pub raw: Value,
pub info: OpenApiInfo,
pub operations: Vec<OpenApiOperation>,
}Fields§
§raw: Value§info: OpenApiInfo§operations: Vec<OpenApiOperation>Implementations§
Source§impl OpenApiSpec
impl OpenApiSpec
Sourcepub async fn from_url(url: &str) -> Result<Self, OpenApiError>
pub async fn from_url(url: &str) -> Result<Self, OpenApiError>
Load and parse an OpenAPI specification from a URL
Sourcepub async fn from_file(path: &str) -> Result<Self, OpenApiError>
pub async fn from_file(path: &str) -> Result<Self, OpenApiError>
Load and parse an OpenAPI specification from a file
Sourcepub fn from_value(json_value: Value) -> Result<Self, OpenApiError>
pub fn from_value(json_value: Value) -> Result<Self, OpenApiError>
Parse an OpenAPI specification from a JSON value
Sourcepub fn to_tool_metadata(&self) -> Result<Vec<ToolMetadata>, OpenApiError>
pub fn to_tool_metadata(&self) -> Result<Vec<ToolMetadata>, OpenApiError>
Convert all operations to MCP tool metadata
Sourcepub fn get_operation(&self, operation_id: &str) -> Option<&OpenApiOperation>
pub fn get_operation(&self, operation_id: &str) -> Option<&OpenApiOperation>
Get operation by operation ID
Sourcepub fn get_operation_ids(&self) -> Vec<String>
pub fn get_operation_ids(&self) -> Vec<String>
Get all operation IDs
Trait Implementations§
Source§impl Clone for OpenApiSpec
impl Clone for OpenApiSpec
Source§fn clone(&self) -> OpenApiSpec
fn clone(&self) -> OpenApiSpec
Returns a duplicate of the value. Read more
1.0.0 · 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 OpenApiSpec
impl RefUnwindSafe for OpenApiSpec
impl Send for OpenApiSpec
impl Sync for OpenApiSpec
impl Unpin for OpenApiSpec
impl UnwindSafe for OpenApiSpec
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