How to use the oas-linter.lint function in oas-linter

To help you get started, we’ve selected a few oas-linter 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 Mermade / oas-kit / packages / oas-validator / index.js View on Github external
function setupOptions(options,openapi) {
    options.valid = false;
    options.context = [ '#/' ];
    options.warnings = [];
    if (!options.lintLimit) options.lintLimit = 5;
    if (!options.lintSkip) options.lintSkip = [];
    options.operationIds = [];
    options.allScopes = {};
    options.openapi = openapi;
    if (options.lint && !options.linter) {
        options.linter = linter.lint;
        linter.loadDefaultRules();
        options.linterResults = linter.getResults;
    }
    if (!options.cache) options.cache = {};
    options.schema = openapi3Schema;
    options.metadata = { lines: -1 };
    if (options.text) options.metadata.lines = options.text.split('\n').length;
    options.ajv = ajv;
}

oas-linter

Default linter plugin for oas-validator

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis