Skip to main content

ResponseModelAliases

Trait ResponseModelAliases 

Source
pub trait ResponseModelAliases {
    // Required method
    fn response_model_aliases() -> &'static [(&'static str, &'static str)];
}
Expand description

Compile-time response model metadata: canonical field names to alias field names.

Implement this with #[derive(fastapi_macros::ResponseModelAliases)].

Required Methods§

Source

fn response_model_aliases() -> &'static [(&'static str, &'static str)]

Returns a mapping of (canonical_name, alias_name) pairs.

Entries with identical names are allowed, but derive implementations typically only include pairs where the alias differs from the canonical name.

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§