Closed daveshirman closed 1 year ago
Indeed it seems that assetSubTypeNames
is a String not a list since you are encoding it as a string your toJson()
method:
'assetsSubTypeNames': jsonEncode(assetSubTypeNames)
My guess is that you should just do:
'assetsSubTypeNames': assetSubTypeNames
You are absolutely correct. My apologies. Thanks!
Background:
fromJson
method, which worksList<String>
Why is it that my
map
object, which has a nestedList<String>
propertyassetSubTypeNames
will serialise fine, but when de-serialising, it's not properly done?The
List<String>
propertyassetSubTypeNames
should be aMap
at this point. Surely?Please explain what I'm doing wrong. Thanks!
Note:
If I add the following code between lines 52 + 53:
it works fine. But I shouldn't have to.
Error