# Atom\_json\_dict/3 options are not as documented

**URL:** <https://swi-prolog.discourse.group/t/atom-json-dict-3-options-are-not-as-documented/9806>\
**Category:** General\
**Tags:** documentation\
**Created:** [August 31, 2026, 11:21am UTC](https://swi-prolog.discourse.group/t/atom-json-dict-3-options-are-not-as-documented/9806 "2026-08-31T11:21:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike.elston](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mike.elston/32/3691_2.png) [@mike.elston](https://swi-prolog.discourse.group/u/mike.elston)\
**Post date:** [August 31, 2026, 11:21am UTC](https://swi-prolog.discourse.group/t/atom-json-dict-3-options-are-not-as-documented/9806/1 "2026-08-31T11:21:14Z")

</div>

**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](https://www.swi-prolog.org/pldoc/man?predicate=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:

```prolog
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:

```prolog
162 ?- atom_json_dict(A,_{a: @(null),b: @(true),c: @(false)},[null(@(null)),true(@(true)), false(@(false))]).
A = '{"a":null,"b":true,"c":false}'.

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [September 1, 2026, 6:59am UTC](https://swi-prolog.discourse.group/t/atom-json-dict-3-options-are-not-as-documented/9806/2 "2026-09-01T06:59:09Z")

</div>

> [@mike.elston](#):
>
> Options are as for [json\_read/3](https://www.swi-prolog.org/pldoc/man?predicate=json_read/3).

Should have been Options are as for json\_read\_dict/3. Those are the same options, but with different defaults. Fixed.
