Closed stuebinm closed 3 years ago
This adds support for records in variants of union types to the derive StaticType macro, e.g:
#[derive(Deserialize, Serialize, StaticType)] enum IntRange { Bounded {min: i64, max: i64}, LowerThan (i64), HigherThan (i64), Unbounded }
will result in the following Dhall type:
< Bounded: { max : Integer, min : Integer } | HigherThan: Integer | LowerThan: Integer | Unbounded >
which can then be used to more conveniently read in nested dhall data.
This is cool, thanks for taking the time! Could you add a test that this works as expected in serde_dhall/tests/traits.rs ?
serde_dhall/tests/traits.rs
Perfect, thanks!
This adds support for records in variants of union types to the derive StaticType macro, e.g:
will result in the following Dhall type:
which can then be used to more conveniently read in nested dhall data.