Closed lestal closed 7 years ago
I've got a map structure in my class:
export class Market { @serializable(map(list(primitive()))) service_map: any; constructor() {} }
What is the proper way to serialize this dynamic map, because I always get "ERROR Error: [serializr] expected JSON array"
Object {member: "dev", campaign: "vacation", service: "free"} Keys are always dynamic (I can not define them as schema) and values as well.
Object {member: "dev", campaign: "vacation", service: "free"}
I solved it, I had to use @serializable(map(primitive())) instead of @serializable(map(list(primitive())))
@serializable(map(primitive()))
@serializable(map(list(primitive())))
I've got a map structure in my class:
What is the proper way to serialize this dynamic map, because I always get "ERROR Error: [serializr] expected JSON array"
Example of such map:
Object {member: "dev", campaign: "vacation", service: "free"}
Keys are always dynamic (I can not define them as schema) and values as well.