Dear #Rust#RustLang folks doing #Axum

What's your preferred way of having a single handler for multiple form submission types?

That is, let's say I have a settings page, and there's different "sections" to the settings, which all get handled differently, but I want the Form to get deserialized per usual?

Unfortunately, serde_html_form doesn't support deserializing enums for something like this? At least not out of the box?

@zkat I haven't tried with serde_html_form, but at least for serde_urlencoded.. (which SHF seems to be a fork of?)

Did you try adding `#[serde(tag = "type")]` to the enum? That way, serde stores the discriminator tag inside of the variant instead of wrapping it, which should work better for "flat" formats like HTML forms.

For example (using axum::Form, which uses serde_urlencoded): https://gist.github.com/nightkr/f07e38a321aae8278ccc1e07bd1bc538

More details: https://serde.rs/enum-representations.html