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
Commanded uses JSON as the event data and metadata serialization format by default. This means that type information is lost when serializing Elixir structs to JSON and requires one to implement the Commanded.Serialization.JsonDecoder to decode strings to their actual Elixir type, such as DateTime.
One possible option for automatic deserialization would be to provide a typespec for the domain event structs and use the defined types to deserialize events. The Spec library provides structure decoding from a typespec and could be used via a custom event store serializer.
The text was updated successfully, but these errors were encountered:
How to deserialize events to their Elixir types.
Commanded uses JSON as the event data and metadata serialization format by default. This means that type information is lost when serializing Elixir structs to JSON and requires one to implement the
Commanded.Serialization.JsonDecoder
to decode strings to their actual Elixir type, such asDateTime
.One possible option for automatic deserialization would be to provide a typespec for the domain event structs and use the defined types to deserialize events. The Spec library provides structure decoding from a typespec and could be used via a custom event store serializer.
The text was updated successfully, but these errors were encountered: