Serde supports untagged enum variants (added in this PR):
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum Foo {
Bar,
Qux,
#[serde(untagged)]
Other(f64),
}
This should result in the following TS type:
export type Foo = "bar" | "qux" | number;
However, if you add Tsify to the derive clause, you get an error instead:
unknown serde variant attribute `untagged`
Serde supports untagged enum variants (added in this PR):
This should result in the following TS type:
However, if you add
Tsifyto the derive clause, you get an error instead: