-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON to OCaml #337
Comments
I'm not aware of a tool like this that people could use today for ATD. I did similar work over ten years ago but it was never released. It's definitely a fun project that doesn't require knowledge of the atd internals. I imagine it could produce good guesses for the most common patterns. Off the top of my head:
Tuples are more exotic but could be inferred given enough data (e.g. Variants that are not just enums are more problematic as they don't have a standard representation outside of ATD. If someone wants to start such a project in OCaml, let us know here! It would be a good fit in this repo. Alternatively, extending another project like https://github.com/mholt/json-to-go to use the ATD syntax could also work. |
@cyberhuman wrote a tool that was doing that. But I don't think it's open source (yet?) |
I wrote a very basic POC long time ago but haven't worked on it ever since: When working on it, I realized that writing an initial atd is very easy, but what I really want is to be able to update it easily when the wire format is updated, or fine-tune auto-detected types. This would require the tool to take the existing atd as an input. |
Thanks for writing this library!
Has there been any work to infer the types directly from the JSON as opposed to having the user add type annotations?
Example: https://github.com/mholt/json-to-go
The text was updated successfully, but these errors were encountered: