How can I serialize a Map<String,Any> into a...
# serialization
d
How can I serialize a Map<String,Any> into a JSON string?
e
It looks like you need to pass a serializer
d
it’s just a simple Map<String,Any> which kind of serializer should I use?
e
you cannot safely serialize
Any
d
what do you recommend to convert a
Map<String,Any>
into a JSON string?
in Golang, you can marshall a
map[string]interface{}
to a JSON string with a single line
j
Convert it to JsonObject or write a serializer that does runtime contextual lookup of serializers for the values
d
Oh, thanks! I wasn’t aware there was a JsonObject 👍
a