diff --git a/utoipa-gen/src/lib.rs b/utoipa-gen/src/lib.rs index dfe9078c..d4889c66 100644 --- a/utoipa-gen/src/lib.rs +++ b/utoipa-gen/src/lib.rs @@ -133,6 +133,20 @@ use self::{ /// _`rename`_ attribute. It behaves similarly to serde's _`rename`_ attribute. If both _serde_ /// _`rename`_ and _schema_ _`rename`_ are defined __serde__ will take precedence. /// +/// ## Enum Unnamed Variant Field Configuration Options +/// +/// * `inline` If the type of this field implements [`ToSchema`][to_schema], then the schema definition +/// will be inlined. **warning:** Don't use this for recursive data types! +/// +/// _**Inline unnamed field variant schemas.**_ +/// ```rust +/// #[derive(ToSchema)] +/// enum Card { +/// Number(#[schema(inline)] Number), +/// Color(#[schema(inline)] Color), +/// } +/// ``` +/// /// # Unnamed Field Struct Optional Configuration Options for `#[schema(...)]` /// * `description = ...` Can be literal string or Rust expression e.g. _`const`_ reference or /// `include_str!(...)` statement. This can be used to override **default** description what is