Add JSON serialisation of DUs (#144)

This commit is contained in:
Patrick Stevens
2024-05-30 12:00:55 +01:00
committed by GitHub
parent 1b3eb03380
commit 35cd94cba1
15 changed files with 473 additions and 158 deletions

View File

@@ -143,6 +143,9 @@ module InnerTypeWithBoth =
node
```
Also includes an *opinionated* serializer for discriminated unions.
(Any such serializer must be opinionated, because JSON does not natively model DUs.)
As in `JsonParse`, you can optionally supply the boolean `true` to the attribute,
which will cause Myriad to stamp out an extension method rather than a module with the same name as the type.