How to use oav - 3 common examples

To help you get started, we’ve selected a few oav 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 Azure / azure-rest-api-specs / test / semantic.js View on Github external
it(swagger + ' should be semantically valid.', function (done) {
      oav.validateSpec(swagger, {consoleLogLevel: 'error'}).then(function (validationResult) {
        //console.dir(validationResult, {depth: null, colors: true});
        done(assert(validationResult.validateSpec && validationResult.validateSpec.errors && validationResult.validateSpec.errors.length === 0, 
        `swagger "${swagger}" contains semantic validation errors.`));
      }).catch(function (err) {
        console.dir(err, {depth: null, colors: true});
        done(err);
      });
    });
  }).value();
github Azure / azure-rest-api-specs / test / model.js View on Github external
it(swagger + ' should have valid examples.', function (done) {
      oav.validateExamples(swagger, null, {consoleLogLevel: 'error'}).then(function (validationResult) {
        //console.dir(validationResult, {depth: null, colors: true});
        done(assert(validationResult.validityStatus === true, `swagger "${swagger}" contains model validation errors.`));
      }).catch(function (err) {
        console.dir(err, {depth: null, colors: true});
        done(err);
      });
    });
  }).value();
github Azure / azure-rest-api-specs / scripts / getStatus.js View on Github external
function runSemanticValidator(swagger) {
  console.log('\t- Running Semantic Validator.')
  return oav.validateSpec(swagger, {consoleLogLevel: 'off'}).then(function (validationResult) {
    //console.dir(validationResult, { depth: null, colors: true });
    return validationResult.validateSpec.errors;
  }).catch(function (err) {
    console.dir(err, { depth: null, colors: true });
  });
}

oav

Validate Azure REST API Specifications

MIT
Latest version published 19 days ago

Package Health Score

84 / 100
Full package analysis