atom_json_dict(-Text, +JSONDict, +Options)
Convert between textual representation and a JSON term represented as a dict. Options are as for json_read/3.
json_read(+Stream, -Term, +Options)
The following options are processed:
…
null(+NullTerm)
Term used to represent JSON null. Default @(null)
true(+TrueTerm)
Term used to represent JSON true. Default @(true)
false(+FalseTerm)
Term used to represent JSON false. Default @(false)
But defaults as documented don’t seem to be active:
159 ?- atom_json_dict(A,_{a: @(null),b: @(true),c: @(false)},[]).
ERROR: Type error: `json_term' expected, found `@(null)' (a compound)
ERROR: In:
ERROR: [16] with_output_to(atom(_8424),json_write_dict(current_output,_8436{a: ...,b: ...,c: ...},[]))
Specifying the defaults explicitly works:
162 ?- atom_json_dict(A,_{a: @(null),b: @(true),c: @(false)},[null(@(null)),true(@(true)), false(@(false))]).
A = '{"a":null,"b":true,"c":false}'.