generate icon indicating copy to clipboard operation
generate copied to clipboard

patternProperties is not supported

Open alixaxel opened this issue 6 years ago • 3 comments

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 {
}

alixaxel avatar Apr 16 '19 14:04 alixaxel

Same problem

lelvisl avatar Apr 29 '19 19:04 lelvisl

👍 need this too.

kujohn avatar Aug 22 '19 21:08 kujohn

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{}

bhearsum avatar Oct 30 '20 02:10 bhearsum