How to use the json-schema/lib/validate.validate function in json-schema

To help you get started, we’ve selected a few json-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github persvr / perstore / facet.js View on Github external
value: function(directives){
								var i, id;

								directives = directives || {};
								if(this != source){
									directives.previous = copy(source, {});
								}
								if(facetPrototype.save){
									facetPrototype.save.call(this, directives);
								}
								var validation = validate(this, facetSchema);
								var instance = this;
								for(i in this){
									if(this.hasOwnProperty(i)){
										transfer(this[i]);
									}
								}
								for (i in source){
									if(source.hasOwnProperty(i) && !this.hasOwnProperty(i)){
										transfer(undefined);
									}
								}
								mustBeValid(validation);
								var isNew = partial === NEW;
								if(isNew && (typeof facetSchema.add === "function")){ //  || )
									partial = undefined;
									id = facetSchema.add(source, directives);