See REST JSON Specification - #2 by cocreature for the same question.
As mentioned in there, the :json
command in daml repl
is very useful for finding the JSON encoding of a given value:
daml> import qualified DA.Set as Set
daml> :json Set.fromList [1,2,3]
{"map":[[1,{}],[2,{}],[3,{}]]}