Skip to main content

ApidocHandlerOps

Trait ApidocHandlerOps 

Source
pub trait ApidocHandlerOps {
    // Required method
    fn augment(paths: &mut Paths);
}
Expand description

Per-handler hook that mutates the Operation generated by #[utoipa::path] for this handler. Implemented by the method macro on the same __path_<fn> struct that carries the utoipa path metadata; the impl iterates every handler argument through the crate::DocOperationSecurity probe.

Called by the extended crate::routes! macro on the Paths returned from utoipa_axum::routes!() before merging into the router. Idempotent — calling Self::augment twice on the same paths leaves the operation unchanged.

Required Methods§

Source

fn augment(paths: &mut Paths)

Apply per-operation augmentations to the operation(s) this handler owns inside paths. Implementations match on <Self as utoipa::Path>::path() and <Self as utoipa::Path>::methods() to pick out the relevant operation(s); no-op when no matching operation is present.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§