pub struct ResolvedOpenAPI { /* private fields */ }Expand description
OpenAPI with every $ref in the document replaced by the item it named.
Built with TryFrom<&OpenAPI>.
Every reference to the same component resolves to the same Shared
allocation, so Shared::as_ptr tells whether two sites named the same
component, and the entries of components are those
very allocations. The document is only ever borrowed from, never taken
apart; see Shared for why.
Implementations§
Source§impl ResolvedOpenAPI
impl ResolvedOpenAPI
Sourcepub fn openapi(&self) -> &str
pub fn openapi(&self) -> &str
See OpenAPI::openapi.
Sourcepub fn info(&self) -> &Info
pub fn info(&self) -> &Info
See OpenAPI::info.
Sourcepub fn servers(&self) -> &[Server]
pub fn servers(&self) -> &[Server]
See OpenAPI::servers.
Sourcepub fn paths(&self) -> &ResolvedPaths
pub fn paths(&self) -> &ResolvedPaths
See OpenAPI::paths.
Sourcepub fn components(&self) -> Option<&ResolvedComponents>
pub fn components(&self) -> Option<&ResolvedComponents>
See OpenAPI::components.
Sourcepub fn security(&self) -> Option<&[SecurityRequirement]>
pub fn security(&self) -> Option<&[SecurityRequirement]>
See OpenAPI::security.
See OpenAPI::tags.
Sourcepub fn external_docs(&self) -> Option<&ExternalDocumentation>
pub fn external_docs(&self) -> Option<&ExternalDocumentation>
Sourcepub fn extensions(&self) -> &IndexMap<String, Value>
pub fn extensions(&self) -> &IndexMap<String, Value>
See OpenAPI::extensions.
Trait Implementations§
Source§impl Debug for ResolvedOpenAPI
impl Debug for ResolvedOpenAPI
Source§impl PartialEq for ResolvedOpenAPI
impl PartialEq for ResolvedOpenAPI
impl StructuralPartialEq for ResolvedOpenAPI
Source§impl TryFrom<&OpenAPI> for ResolvedOpenAPI
impl TryFrom<&OpenAPI> for ResolvedOpenAPI
Source§fn try_from(openapi: &OpenAPI) -> Result<Self, Self::Error>
fn try_from(openapi: &OpenAPI) -> Result<Self, Self::Error>
Resolves every $ref in the document.
Fails with the first reference that does not resolve. A schema that
contains a reference back to itself is fine, and comes out with a
NestedSchema edge that is recursive; any other component that
contains itself has no finite tree form and fails with
ResolveError::CyclicReference.