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

error: Undefined should be an object #54

Open
alandotcom opened this issue Jun 3, 2015 · 0 comments
Open

error: Undefined should be an object #54

alandotcom opened this issue Jun 3, 2015 · 0 comments

Comments

@alandotcom
Copy link

var schema = {
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Result",
  "type": "object",
  "properties": {
    "additional_info": {
      "description": "More info",
      "type": "object",
    }
  },
  "additionalProperties": false
}

var instance = {additional_info: undefined};

var JaySchema = require('jayschema');
var js = new JaySchema();


js.validate(instance, schema, function(errs) {
  if (errs) { console.error(errs); }
  else { console.log('validation OK!'); }
});

/*
 * [ { [Error]
 *     instanceContext: '#/additional_info',
 *     resolutionScope: 'anon-schema://8acc7aec06a4b148e96a2130384cea97b268413d/#/properties/additional_info',
 *     constraintName: 'type',
 *     constraintValue: 'object',
 *     testedValue: 'undefined' } ]
 */
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