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
Let's say you want to use ClosedStruct or Struct or OpenStruct or event a String as data. You also configured a mapper/serializer in a way which knows how to handle such classes an how to serializer/deserialize them properly. Why should RES enforce it to be a Hash? Why can it not be anything else?
The impact should be minimal in my opinion:
the documentation shows Hashes
the user can wrap mapper with one that does to_h conversion
the user can add to_h calls in all places which instantiate events
the user can use its own class inheritance to add to_h conversion and call super with modified arguments.
The text was updated successfully, but these errors were encountered:
This allows putting anything as data, eg. nil, Array, Struct, etc.
However, we added {} as a default value for the data to prevent breaking
applications relying on data being hash and using methods like [] or
fetch.
[#395]
I see no value in that behavior:
Let's say you want to use
ClosedStruct
orStruct
orOpenStruct
or event aString
asdata
. You also configured a mapper/serializer in a way which knows how to handle such classes an how to serializer/deserialize them properly. Why should RES enforce it to be aHash
? Why can it not be anything else?The impact should be minimal in my opinion:
to_h
conversionto_h
calls in all places which instantiate eventsto_h
conversion and callsuper
with modified arguments.The text was updated successfully, but these errors were encountered: