-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
Description
Hi,
I've the following json format to parse:
I can have either:
{"type":"address", "content":string}
or:
{"type":"coord", "content":{"latitude":float, "longitude":float}}
And what I would like to do is something like that:
type geo_coord =
{ latitude : float
; longitude : float
} [@@deriving yojson]
type coord =
| Adresse [@name "address"] of string
| GeoCoordinates [@name "coord"] of geo_coord
[@@deriving yojson]
[@@deriving_field_name "type"]
Is it already possible to do something like that or otherwise, is it possible to add such a feature ?