Open callumlocke opened 5 years ago
Hi!
I just found this library because we would like to generate some Go code from our JSON-Schema. This feature is exactly what is missing from all the JSON-Schema -> Code converters we found.
I was wondering if you already planned to add this in your roadmap and if we could somehow help you to make this one happen. 🙂
Thanks
Same here!!!!
+1 addition to what mentioned above, Im looking for unique values in array.
Take this example JSON Schema, with integers restricted to certain ranges:
Currently, if you use quicktype to generate JavaScript or TypeScript from the above, the generated runtime validation functions only enforce that
latitude
andlongitude
are numbers.It would be great if they could also enforce the
minimum
,maximum
and other restrictions.Here's a non-exhaustive list of restrictions I believe are not currently enforced by generated validation functions (gathered from this site):
For the case of generated TypeScript definitions, it might make sense to generate opaque types to represent restricted types, as well as safe casting functions. Something like: