thingsboard / dart_thingsboard_client

ThingsBoard API client library for Dart developers.
BSD 3-Clause "New" or "Revised" License
59 stars 30 forks source link

Getting json attributes #17

Closed marcantoinebouchard closed 8 months ago

marcantoinebouchard commented 11 months ago

Using getAttributesByScope or getAttributeKvEntries on a json attribute crashes with exception:

"type 'List<dynamic>' is not a subtype of type 'String'"

The stack trace is:

#0      RestJsonConverter._parseValue (package:thingsboard_client/src/model/telemetry_models.dart:359:42)
#1      RestJsonConverter.toAttributes.<anonymous closure> (package:thingsboard_client/src/model/telemetry_models.dart:325:21)
#2      MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31)
#3      ListIterator.moveNext (dart:_internal/iterable.dart:344:26)
#4      new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#5      new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#6      new List.of (dart:core-patch/array_patch.dart:47:28)
#7      ListIterable.toList (dart:_internal/iterable.dart:214:7)
#8      RestJsonConverter.toAttributes (package:thingsboard_client/src/model/telemetry_models.dart:327:10)
#9      AttributeService.getAttributesByScope (package:thingsboard_client/src/service/attribute_service.dart:49:30)
<asynchronous suspension>
...