json-schema-to-elm
json-schema-to-elm copied to clipboard
Support patternProperties
As far as I can tell, there is currently no support for patternProperties, arguably one of the more useful features of JSON schema.
Here is how I'd imagine to map things. Say we have two different patterns:
{
"title": "main",
"patternProperties": {
"regexp1": {
"title": "title1",
...
},
"regexp2": {
"title": "title2"
...
}
}
}
This would translate to something like this:
type alias Main =
{ title1 : Dict String a
, title2 : Dict String b
}
Here, the string keys would be the JSON key (matching the respective regexp), and a resp. b would be the types defined by the resp. ....