salvo-rs/salvo

Derive `ToSchema` not work for unit enum variants

cryscan opened this issue · 0 comments

This code no longer compiles upgrading from v0.69.0 to v0.71.0:

use serde::{Deserialize, Serialize};
use salvo::oapi::ToSchema;

#[derive(Debug, Default, Clone, Serialize, Deserialize, ToSchema)]
#[serde(untagged)]
pub enum Array<T> {
    #[default]
    None,    // Error: unit variant `Null` is not publicly re-exported
    Item(T),
    Vec(Vec<T>),
}

57c932e1580013cd693e85c1d2516720