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

json schema validator - required? #9

Open
OwenMelbz opened this issue Feb 26, 2014 · 0 comments
Open

json schema validator - required? #9

OwenMelbz opened this issue Feb 26, 2014 · 0 comments

Comments

@OwenMelbz
Copy link

Hi, do you/will you have support for the required properties?

For example to pass this

var event = {"controller":"dash","type":"launch","data":{},"method":null};


var schema = {
    properties : {
        controller  : { type: 'string' },
        data        : { type: 'object' },
        method      : { type: 'any' }
    },
    required: ['controller', 'data', 'method', 'bacon']
}

var valid = Schema.validate(event, schema);

@returns {"valid":true,"errors":[]}

at the moment this returns valid.valid = true, even though bacon doesnt exist

thanks

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

1 participant