generate
generate copied to clipboard
patternProperties is not supported
It seems that whenever my JSONSchema makes use of the patternProperties constructor, the resulting struct is empty.
optionalCategoriesList: {
type: 'object',
patternProperties: {
'^[0-9]+$': { type: 'string' },
},
additionalProperties: false,
},
Output:
// OptionalCategoriesList
type OptionalCategoriesList struct {
}
Same problem
👍 need this too.
I think to support this you'd have to use a map instead of a struct, and even then I'm not sure it's possible to fully reflect a JSON schema as a fully typed Go struct or map.
Personally, I'm going to take the approach of validating any complex JSON against a JSON Schema, and then reading it into a simple map[string]interface{}