Jonas Bushart

Results 121 comments of Jonas Bushart

I think I identified the issue. The problem is that the `serde_as` macro does not recognize the attribute in this position. Currently, I think it only supports attributes on fields,...

I decided not to support `serde_as` on enum variants for now. But instead, an error will be issued when this happens. Your idea of showing an example how to use...

This is a very interesting idea. I have a couple of remarks / incompatibility observations. Maybe some of them can be resolved. Currently, the `Foo` type ultimately decides if a...

You can deserialize internally tagged enums from sequences, so forcing `deserialize_map` is not an option. The enum below can be deserialized from these JSONs `["Bool", false]` and `["Int", 123]`. ```rust...

I found a way to make this example work. The code is based on this incomplete PR of me https://github.com/jonasbb/serde_with/pull/375. The additional `deser_value_field` function is necessary to 1) signal that...

Hi, thanks for the interest. I am open to accepting a PR to add this macro. I have not seen much demand for such a macro so far. The implementation...

The code panics because you are calling `expect` on the return value. It is not a panic stemming from serde. If you look at the [variant documentation,](https://serde.rs/variant-attrs.html) you can see...

While I do not know why the derive does not allow this, you can quite easily "simulate" it: ```rust use serde_with::rust::deserialize_ignore_any; #[derive(Deserialize)] #[serde(untagged)] enum Item { Foo{x: u8}, #[serde(deserialize_with =...

I want to mention one alternative using [`serde_with::with_prefix`](https://docs.rs/serde_with/1.6.4/serde_with/macro.with_prefix.html). It's a bit less boilerplate than applying `rename` on every field. It is not a replacement for having it integrated directly into...

This seems like a useful addition. I think I would prefer this to exists as a `serde_as` compatible type, which allows it to be used for nested types. This could...