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 you can see here #1300 , ADTs are not encoded the same way in scala 2 and scala 3.
Looking at the scala 2 code, it's just lagging behind in term of feature (it doesn't detect object-only ADTs whereas scala 3 code do).
We could synchronize both versions.
But on some projects, we rely on the scala 2 encoding and we would need to be able to choose this encoding in both scala 2 and scala 3.
By the way, the rational about encoding objects as { "myObject": {} } is : if/when you add a case class to your ADT, you can still parse previous ADT values. If you choose to encode as a simple value, the backward compatibility is much more tricky.
So what about adding a configuration : alwaysEncodeEnumAsObjects?
If you think the feature is a good idea, I can try to propose a PR.
What do you think?
The text was updated successfully, but these errors were encountered:
As you can see here #1300 , ADTs are not encoded the same way in scala 2 and scala 3.
Looking at the scala 2 code, it's just lagging behind in term of feature (it doesn't detect object-only ADTs whereas scala 3 code do).
We could synchronize both versions.
But on some projects, we rely on the scala 2 encoding and we would need to be able to choose this encoding in both scala 2 and scala 3.
By the way, the rational about encoding objects as
{ "myObject": {} }
is : if/when you add a case class to your ADT, you can still parse previous ADT values. If you choose to encode as a simple value, the backward compatibility is much more tricky.So what about adding a configuration :
alwaysEncodeEnumAsObjects
?If you think the feature is a good idea, I can try to propose a PR.
What do you think?
The text was updated successfully, but these errors were encountered: