pub struct OpenApiSpec {
pub openapi: String,
pub info: OpenApiInfo,
pub servers: Vec<OpenApiServer>,
pub paths: HashMap<String, PathItem>,
pub components: Option<Components>,
pub security: Vec<HashMap<String, Vec<String>>>,
}Expand description
OpenAPI 3.0+ specification (partial - only what we need).
Fields§
§openapi: StringOpenAPI version (must be 3.0+)
info: OpenApiInfoAPI info
servers: Vec<OpenApiServer>Servers (for base URL)
paths: HashMap<String, PathItem>Path definitions
components: Option<Components>Security definitions
security: Vec<HashMap<String, Vec<String>>>Top-level security requirements
Implementations§
Source§impl OpenApiSpec
impl OpenApiSpec
Sourcepub fn to_api_config(&self, api_name: Option<&str>) -> ApiConfig
pub fn to_api_config(&self, api_name: Option<&str>) -> ApiConfig
Convert the OpenAPI spec to an ApiConfig.
Sourcepub fn tools_by_tag(&self, tag: &str) -> Vec<(&str, &str, &Operation)>
pub fn tools_by_tag(&self, tag: &str) -> Vec<(&str, &str, &Operation)>
Get tools filtered by tag.
Get all unique tags.
Sourcepub fn endpoint_count(&self) -> usize
pub fn endpoint_count(&self) -> usize
Count total endpoints.
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 moreSource§impl Debug for OpenApiSpec
impl Debug for OpenApiSpec
Source§impl<'de> Deserialize<'de> for OpenApiSpec
impl<'de> Deserialize<'de> for OpenApiSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OpenApiSpec
impl RefUnwindSafe for OpenApiSpec
impl Send for OpenApiSpec
impl Sync for OpenApiSpec
impl Unpin for OpenApiSpec
impl UnsafeUnpin 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