Skip to content

Commit

Permalink
Add experimental support for Maps
Browse files Browse the repository at this point in the history
Experimental because we discard the keys and treat it as a regular list.
  • Loading branch information
janseeger committed Nov 13, 2024
1 parent 9acfbde commit 6c7ebb9
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ class StringMapToObjectDecoder(
)

StructureKind.LIST -> {
val list = (value as Iterable<Any>)
.toCollection(mutableListOf())
val list = when (value) {
is Iterable<*> -> (value as Iterable<Any>).toCollection(mutableListOf())
is Map<*, *> -> (value.values as Iterable<Any>).toCollection(mutableListOf())
else -> emptyList<Any>()
}

return ListDecoder(
list = ArrayDeque(list),
Expand Down

0 comments on commit 6c7ebb9

Please sign in to comment.