I have a hypothetical use case where I want to:
- have some kind of dhall type / schema (let’s call it
Foo) - write instances of this type in dhall (as in
let instance = Foo::{ ... }) - generate a JSON schema for this type as well
I want both the outputs (as JSON/YAML) and the JSON schema, because I want to build a kubernetes CustomResource representing Foo, which I’d generate using a dhall pipeline, but I others would also publish (and not all would be using dhall).
There’s been some talk of generating dhall schemas from JSON schemas, but is the opposite possible?
I imagine you could easily write a dhall type for JSON schemas, i.e. allow writing JSON Schemas in dhall. But I want a single source which can be used to derive both a a JSON schema and a dhall type.
. I mean, you could write the “JSON Schema” in dhall form rather than unstructured JSON, but in practice it’d be able to parse raw JSONSchema (