Closed Mereep closed 3 weeks ago
Enums (or any non-primitive) value are currently not supported. You have to put the string directly.
Regarding functions you can define a top-level or static function and use that.
Since I have no plans to change the implementation here I'll go ahead and close the issue.
Hello,
I got an
Enum
defined as follows:which I use in a class as follows (Super class)
Childs:
This does serialize fine, however deserializing does not work. This is due (in file
class_mapper.dart
)will have
discriminator
set to the Enum-Type butvalue[discriminatorKey]
is actually the String representation, thusidentical
and==
will fail.In my eyes this should work. Or do I use it wrong :)
Side Note Althought
discriminatorValue
does seem to have a support for defining functions (which could be used to sidetrack this), will not work for annotations ascannot be used as a workaround as this is not a const expression.