Struct aide::transform::TransformOpenApi
source · pub struct TransformOpenApi<'t> { /* private fields */ }
Expand description
A transform helper that wraps OpenApi
.
Implementations§
source§impl<'t> TransformOpenApi<'t>
impl<'t> TransformOpenApi<'t>
sourcepub fn description(self, description: &str) -> Self
pub fn description(self, description: &str) -> Self
Set the description.
sourcepub fn default_response<R>(self) -> Selfwhere
R: OperationOutput,
pub fn default_response<R>(self) -> Selfwhere R: OperationOutput,
Set a default response for all operations that do not already have one.
sourcepub fn default_response_with<R, F>(self, transform: F) -> Selfwhere
R: OperationOutput,
F: Fn(TransformResponse<'_, R::Inner>) -> TransformResponse<'_, R::Inner> + Clone,
pub fn default_response_with<R, F>(self, transform: F) -> Selfwhere R: OperationOutput, F: Fn(TransformResponse<'_, R::Inner>) -> TransformResponse<'_, R::Inner> + Clone,
Set a default response for all operations that do not already have one.
This method additionally accepts a transform function to modify the generated documentation.
sourcepub fn security_scheme(self, name: &str, scheme: SecurityScheme) -> Self
pub fn security_scheme(self, name: &str, scheme: SecurityScheme) -> Self
Add a security scheme.
sourcepub fn security_requirement(self, security_scheme: &str) -> Self
pub fn security_requirement(self, security_scheme: &str) -> Self
Add a global security requirement.
sourcepub fn security_requirement_multi<'a, I>(self, security_schemes: I) -> Selfwhere
I: IntoIterator<Item = &'a str> + Clone,
pub fn security_requirement_multi<'a, I>(self, security_schemes: I) -> Selfwhere I: IntoIterator<Item = &'a str> + Clone,
Add multiple global security requirement.
sourcepub fn security_requirement_scopes<I, S>(
self,
security_scheme: &str,
scopes: I
) -> Selfwhere
I: IntoIterator<Item = S>,
S: Into<String>,
pub fn security_requirement_scopes<I, S>( self, security_scheme: &str, scopes: I ) -> Selfwhere I: IntoIterator<Item = S>, S: Into<String>,
Add required scopes to a global security requirement.
If the scheme requirement does not exist, it will be added.
sourcepub fn security_requirement_multi_scopes<'a, I, IS, S>(
self,
security_schemes: I,
scopes: IS
) -> Selfwhere
I: IntoIterator<Item = &'a str> + Clone,
IS: IntoIterator<Item = S>,
S: Into<String>,
pub fn security_requirement_multi_scopes<'a, I, IS, S>( self, security_schemes: I, scopes: IS ) -> Selfwhere I: IntoIterator<Item = &'a str> + Clone, IS: IntoIterator<Item = S>, S: Into<String>,
Add required scopes to multi global security requirement.
If the scheme requirement does not exist, it will be added.
Auto Trait Implementations§
impl<'t> RefUnwindSafe for TransformOpenApi<'t>
impl<'t> Send for TransformOpenApi<'t>
impl<'t> Sync for TransformOpenApi<'t>
impl<'t> Unpin for TransformOpenApi<'t>
impl<'t> !UnwindSafe for TransformOpenApi<'t>
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