Generate Idris 2 data types from a JSON Schema.
Run:
make all
Run:
./build/exec/json-schema schemaFile.json
to generate schemaFile.idr
.
Suppose we have a JSON schema filmSchema.json
, given by:
{
"type": "object",
"properties": {
"title": {
"type": "string"
},
"year": {
"type": "number"
}
}
}
Then when we run ./build/exec/json-schema filmSchema.json
, we generate the filmSchema.idr
file, with contents:
public export
record Main where
constructor MkMain
title : String
year : Double