Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support patternProperties #44

Open
reitzig opened this issue Sep 18, 2017 · 0 comments
Open

Support patternProperties #44

reitzig opened this issue Sep 18, 2017 · 0 comments

Comments

@reitzig
Copy link

reitzig commented Sep 18, 2017

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. ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants