Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Support for objects with a single field whose name indicates the type of the value. For instance,
{
"User": {
"id": "abc123",
"age": 52
}
}
gets converted into
[
"User",
{
"id": "abc123",
"age": 52
}
]
An ATD type definition for this is
type obj = [
| User of user
| ...
] <json adapter.ocaml="Atdgen_runtime.Json_adapter.One_field">
type user = {
id: string;
age: int;
}