Skip to content

Commit 72f39b8

Browse files
mjambonclaude
andauthored
CHANGES: document <json repr="object"> for sum types across all 7 backends (#493)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 15cc023 commit 72f39b8

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

CHANGES.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ unreleased
66
ATD spec, compiles it, feeds JSON to stdin, and checks the output.
77
atdml is the first backend to run these tests.
88

9-
* atdml: Add `<json repr="object">` on sum types. Tagged variants are encoded
10-
as single-key JSON objects `{"Constructor": payload}` instead of the default
11-
`["Constructor", payload]` arrays. Unit variants are unaffected (`"Constructor"`
12-
strings). This matches Serde's externally-tagged representation. Both
13-
`of_yojson` and `of_jsonlike` readers are generated automatically.
9+
* All backends: Add `<json repr="object">` on sum types. Tagged variants are
10+
encoded as single-key JSON objects `{"Constructor": payload}` instead of the
11+
default `["Constructor", payload]` arrays. Unit variants are unaffected
12+
(`"Constructor"` strings). This matches Serde's externally-tagged
13+
representation and produces idiomatic YAML (a single-key mapping rather than
14+
a two-element sequence). Supported in: atdml (OCaml), atdpy (Python),
15+
atdts (TypeScript), atdcpp (C++), atdd (D), atdj (Java), atds (Scala).
16+
atdml additionally generates `of_jsonlike` readers automatically.
1417

1518
* New package: **`atd-jsonlike`**. Defines a generic JSON-like AST
1619
(`Atd_jsonlike.AST.t`) with source location information at every node.

0 commit comments

Comments
 (0)