rascal icon indicating copy to clipboard operation
rascal copied to clipboard

Automatic ADT generation from JSON Schema docs?

Open nfi-hashicorp opened this issue 10 months ago • 5 comments

Hi there, new Rascal user, just kicking the tires. 👋

I'm wondering if it would be easy/possible/palatable to add some feature to the Rascal stdlib to generate ADT code given a JSON Schema. I don't know Rascal nor JSON Schema super well, but they seem to map pretty closely.

My use case is that I'm sketching a DSL for Github Workflows that's a little nicer to work with versus their YAML representation. Right now, I'm using lang::yaml::Model to source-to-source transform my DSL ADTs into YAML, and then dumpYAMLing into files. I was thinking I could also write an ADT that is closer to the YAML representation, and transform into that, which would then transform to lang::yaml::Model. There's already a JSON Schema for workflows and it would be nice if it I could just generate ADTs from it.

Just an idea!

nfi-hashicorp avatar Jan 30 '25 18:01 nfi-hashicorp