dashboardjavacloudcoapiotiot-analyticsiot-platformiot-solutionskafkalwm2mmicroservicesmiddlewaremqttnettyplatformsnmpthingsboardvisualizationwebsocketswidgets
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
533 B
24 lines
533 B
var inspector = require('../');
|
|
|
|
var schema = {
|
|
type: 'object',
|
|
properties: {
|
|
lorem: { type: 'string', eq: 'ipsum' },
|
|
dolor: {
|
|
type: 'array',
|
|
items: { type: 'number' }
|
|
}
|
|
}
|
|
};
|
|
|
|
var candidate = {
|
|
lorem: 'not_ipsum',
|
|
dolor: [ 12, 34, 'ERROR', 45, 'INVALID' ]
|
|
};
|
|
var result = inspector.validate(schema, candidate, function (err, result) {
|
|
console.log(result);
|
|
});
|
|
|
|
// var schema = { type: 'object', properties: { lol: { someKeys: ['pouet'] } } };
|
|
// var subject = { lol: null };
|
|
// inspector.validate(schema, subject);
|
|
|