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

patternProperties is not supported #61

Open
alixaxel opened this issue Apr 16, 2019 · 3 comments
Open

patternProperties is not supported #61

alixaxel opened this issue Apr 16, 2019 · 3 comments

Comments

@alixaxel
Copy link

alixaxel commented Apr 16, 2019

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 {
}
@lelvisl
Copy link

lelvisl commented Apr 29, 2019

Same problem

@kujohn
Copy link

kujohn commented Aug 22, 2019

👍 need this too.

@bhearsum
Copy link

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

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

No branches or pull requests

4 participants