Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Untagged variant will make tagged ones unparsable #409

@ImUrX

Description

@ImUrX

If you have an enum like this:

#[derive(Serialize, Deserialize, Debug)]
enum Enum {
	Tagged(String),
	#[serde(untagged)]
	Untagged(usize),
}

will fail to parse this yml:

- !Tagged example

Message: called `Result::unwrap()` on an `Err` value: Error(".[0]: untagged and internally tagged enums do not support enum input", line: 2, column: 3)
but if you remove the #[serde(untagged)] then it will be parsable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions