You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now specta_typescript always applies Serde tagging.
We investigated moving this process to specta_serde but that's not possible because Typescript is tagged by content while other languages are not. So you end up with something like:
Say you have enum T { A }. A is exported to TS as null by default but when you run it through specta_serde what does it become? You would think it goes from Fields::Unit to Fields::Unnamed(vec![ Field::new(DataType::Literal(LiteralType::String("A") ]). Now that's fine but then export that same typemap to Rust and you effectively get enum T { A("A") } which is not possible.
Should we make it configurable?
untagged in the equivalent of the approach we looked at for `specta_serde
Should we move tagging configuration to specta_typescript specific context? Well the Rust exporter should include the json tagging attribute so maybe this is just not possible, idk.
The text was updated successfully, but these errors were encountered:
Right now
specta_typescript
always applies Serde tagging.We investigated moving this process to
specta_serde
but that's not possible because Typescript is tagged by content while other languages are not. So you end up with something like:Say you have
enum T { A }
.A
is exported to TS asnull
by default but when you run it throughspecta_serde
what does it become? You would think it goes fromFields::Unit
toFields::Unnamed(vec![ Field::new(DataType::Literal(LiteralType::String("A") ])
. Now that's fine but then export that same typemap to Rust and you effectively getenum T { A("A") }
which is not possible.Should we make it configurable?
untagged
in the equivalent of the approach we looked at for `specta_serdeShould we move tagging configuration to
specta_typescript
specific context? Well the Rust exporter should include the json tagging attribute so maybe this is just not possible, idk.The text was updated successfully, but these errors were encountered: