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
serde.compat.SerdeError: Can not deserialize 'a' of type str into Union[SingleId, DoubleId].
Reasons:
Failed to deserialize into SingleId: name 'SingleId' is not defined
Failed to deserialize into DoubleId: Unsupported type: str
I can work around for now, by just using the built in types and then casting after, but it would be great if supported by serde.
Thoughts?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This currently doesn't work:
If I
to_yaml(Config(id=Id('b')))
I get:and when I
from_yaml
I get back astr
, not anId
:My use case for this is that I want to:
a. Add extra methods on to
Id
b. Support multiple ID types via a union, and have
serde
select the correct one, e.g.:which currently fails with:
I can work around for now, by just using the built in types and then casting after, but it would be great if supported by
serde
.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions