pub struct ValidationContext<'a> { /* private fields */ }Expand description
Context for validation of OpenAPI specifications.
Implementations§
Source§impl<'a> ValidationContext<'a>
impl<'a> ValidationContext<'a>
Sourcepub fn ident(&self) -> &ApiIdent
pub fn ident(&self) -> &ApiIdent
Retrieves the identifier of the API being validated.
This identifier is set via the OpenAPI manager’s ManagedApiConfig
type.
Sourcepub fn file_name(&self) -> &ApiSpecFileName
pub fn file_name(&self) -> &ApiSpecFileName
Returns a descriptor for the API’s file name.
Sourcepub fn metadata(&self) -> &ManagedApiMetadata
pub fn metadata(&self) -> &ManagedApiMetadata
Retrieves optional metadata for the API being validated.
Sourcepub fn report_error(&mut self, error: Error)
pub fn report_error(&mut self, error: Error)
Reports a validation error.
Sourcepub fn record_file_contents(
&mut self,
path: impl Into<Utf8PathBuf>,
contents: Vec<u8>,
)
pub fn record_file_contents( &mut self, path: impl Into<Utf8PathBuf>, contents: Vec<u8>, )
Records that the file has the given contents.
In check mode, if the files differ, an error is logged.
In generate mode, the file is overwritten with the given contents.
The path is treated as relative to the root of the repository.
Auto Trait Implementations§
impl<'a> Freeze for ValidationContext<'a>
impl<'a> !RefUnwindSafe for ValidationContext<'a>
impl<'a> !Send for ValidationContext<'a>
impl<'a> !Sync for ValidationContext<'a>
impl<'a> Unpin for ValidationContext<'a>
impl<'a> !UnwindSafe for ValidationContext<'a>
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