pub struct OpenApiSchema { /* private fields */ }Expand description
A parsed OpenAPI document with its Operation values indexed by
(path, METHOD) (OAPI-04 / D-03).
Runtime-OPTIONAL: the binary holds an Option<OpenApiSchema> and only parses
when the operator supplies a spec. Retains the raw spec text so the code-mode
api_schema resource (D-03 surface (a)) can serve it verbatim.
Implementations§
Source§impl OpenApiSchema
impl OpenApiSchema
Sourcepub fn parse(text: &str) -> Result<Self, HttpConnectorError>
pub fn parse(text: &str) -> Result<Self, HttpConnectorError>
Parse an OpenAPI spec from JSON, falling back to YAML.
Tries serde_json first (the common machine-emitted shape), then
serde_yaml. The retained spec text is text verbatim so the
api_schema resource serves exactly what the operator supplied.
§Errors
Returns HttpConnectorError::Backend when the text is neither valid
OpenAPI JSON nor YAML. The error message carries a static reason only —
it does NOT echo the (admin-authored) spec body (T-90-03-03 discipline).
Sourcepub fn parse_path(path: &Path) -> Result<Self, HttpConnectorError>
pub fn parse_path(path: &Path) -> Result<Self, HttpConnectorError>
Read and parse an OpenAPI spec from a file path.
§Errors
Returns HttpConnectorError::Backend when the file cannot be read or
the contents do not parse. The error message carries a static reason and
never echoes the file path or spec body (T-90-03-03 discipline).
Sourcepub fn operations(&self) -> &[Operation]
pub fn operations(&self) -> &[Operation]
All extracted operations, in document order.
Trait Implementations§
Source§impl Clone for OpenApiSchema
impl Clone for OpenApiSchema
Source§fn clone(&self) -> OpenApiSchema
fn clone(&self) -> OpenApiSchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for OpenApiSchema
impl RefUnwindSafe for OpenApiSchema
impl Send for OpenApiSchema
impl Sync for OpenApiSchema
impl Unpin for OpenApiSchema
impl UnsafeUnpin for OpenApiSchema
impl UnwindSafe for OpenApiSchema
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more