Newbie Reason developer here!
I have a Js project which uses, for it’s serialization format, a json schema which ~1500 lines (58kB) and the ajv
library is used at runtime for validation and command-line ajv
for debugging and checking.
I am aware of bs-json
and I also watched Sean Grove’s talk “Having your cake and eating it too – GraphQL in Reason | ReasonConf 2018”, where he demoed a JSON -> ATD app (atdgen
).
Alas, GraphQL is not an option for this project, currently. However, atggen
is pretty close to what I’m looking for. I skimmed through the docs at atd.readthedocs.io/en and I did not see any mention of Json Schema.
I also noticed bs-ajv
and in the examples there, the schema is represented in Reason code, not as a schema.json file (my scenario).
What I am wondering is how a Reason user would approach bridging between Js and Reason in a large-ish json-schema case like this? What are the different options be for parsing and serializing json data with json schema validation, varying from the quick and dirty/unsafe, to laboriously creating nested type defs in Reason?
It probably would not take long code all the nested type defs in Reason (a day?) but then once that is done then there is pretty much no point in maintaining the schema.json
file itself anymore- otherwise there would be 2 canonical definitions of the schema?
Just trying to get an idea of the options and the big picture. Thanks so much!