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

type is required with patternProperties #2

Open
LarsBV opened this issue Sep 18, 2014 · 1 comment
Open

type is required with patternProperties #2

LarsBV opened this issue Sep 18, 2014 · 1 comment

Comments

@LarsBV
Copy link

LarsBV commented Sep 18, 2014

If you write

foobar {
    properties: {
         name: { type: 'string'}.
         files: {
               patternProperties: {
                     "^[a-z]+$": {
                           filename: {type:'string'}
                     }
                }
         }
    }
}

then you have too add,
foobar.type = 'object'

even though:

hello: {
    properties: {
        message: {type: 'string'}
    }
}

doesn't require it. After having been bitten by it, this late evening, I think it should have a consistent
behavior.

At the same time a nice error message when no validators have been found would be nice.
Currently if the scheme doesn't match up, atleast in my case, it outputs 'Cannot read property 'validators' of undefined'

@vmakhaev
Copy link
Member

Sorry for delay.
Yes, error messages can be more informative. I have plans to do it.

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

2 participants