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
If I declare the field like JsonObject it does not break, and internally it contains the proper MapJsonObject. It seems that the way to find the proper serializer uses
Expected
If I declare the Type like MapJsonObject it should work fine so everyone that use the model could know if it contains a list, a map or what.
It never occurred to me that someone would want to do this :) but I agree it makes sense. I'll mark it as a feature request and see if there's some way to support it--next time I am working on built_value features. (I only do that every quarter or so).
MapJsonObject
it breaks saying:Error:
Even If I declare the
JsonObjectSerializer
(like #1159) like this:JsonObject
it does not break, and internally it contains the properMapJsonObject
. It seems that the way to find the proper serializer usesExpected
If I declare the Type like
MapJsonObject
it should work fine so everyone that use the model could know if it contains a list, a map or what.Investigation
It seems that the
BuiltJsonSerializer
use only the first type to find serializers:https://github.com/google/built_value.dart/blob/master/built_value/lib/src/built_json_serializers.dart#L53
The
JsonObjectSerializer
contains all types here but since the other one just one the first one then it can not find the serializer for it:https://github.com/google/built_value.dart/blob/master/built_value/lib/src/json_object_serializer.dart#L12-L19
The text was updated successfully, but these errors were encountered: