GenSON
GenSON copied to clipboard
how to add pattern for each field
for some fields, i need add pattern in schema conf, and how to add pattern for each field?
thanks
Are you talking about patternProperties where you specify a RegExp for the key, or do you want to add a pattern to match the value of a property?
Oh this is an interesting one. What about a --infer-patterns optional argument that takes a list of json paths? It could construct a minimal DFA for those keys and convert it to a regexp or something like that.
This sounds a bit over-complicated. If you implement it, I'll take a look, but beware of complicating the API. Favor seed schemas over configuration options.