Reputation: 1031
I have two lists that look like this:
List("key1", "key2")
List("val1", "val2")
I'm trying to get it into this JSON-like format:
[{"key1":"val1"},{"key2","val2"}]
Right now, this is what I'm using:
val output = List(attrKeys.zip(attrValues).toMap)
But it gives me this:
[{"key1":"val1","key2":"val2"}]
How do I get this into a list of separate map objects?
Upvotes: 0
Views: 203