Sounds like something that can be debugged. If you can post a small repro that shows the problem, we can help. Here’s a small working example that I created a while back: GitHub - yawaramin/gen_json_string: Utility to generate fake JSON data from a JSON Schema
EDIT: lots more examples in the tests: ppx_deriving_yojson/test_ppx_yojson.ml at master · ocaml-ppx/ppx_deriving_yojson · GitHub
W.r.t. atdgen, if you are looking for a more widely-supported serialization stack, there are other options like Thrift-JSON, and even GraphQL.