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
As the Sorbet docs themselves admit, T::Struct#serialize has some surprising behavior, such that it is often better to implement serialization by hand.
To avoid these issues, it would be nice to have a rule that disallows T::Struct#serialize. Ideally it would include these additional features:
It should link to the Sorbet docs that explain why we're make this recommendation
It should link to an example of the preferred pattern
It should respect an allowlist of exceptions
It should not discourage use of T::Enum#serialize (which is safer)
I'm happy to contribute an implementation for review, but I'd love to hear any feedback about this approach in the meantime!
The text was updated successfully, but these errors were encountered:
As the Sorbet docs themselves admit,
T::Struct#serialize
has some surprising behavior, such that it is often better to implement serialization by hand.To avoid these issues, it would be nice to have a rule that disallows
T::Struct#serialize
. Ideally it would include these additional features:T::Enum#serialize
(which is safer)I'm happy to contribute an implementation for review, but I'd love to hear any feedback about this approach in the meantime!
The text was updated successfully, but these errors were encountered: