Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@redocly/openapi-core

Package Overview
Dependencies
Maintainers
3
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redocly/openapi-core - npm Package Compare versions

Comparing version 1.0.0-beta.22 to 1.0.0-beta.23

lib/benchmark/benches/lint-with-many-rules.bench.d.ts

2

__tests__/normalizeVisitors.test.ts
import { normalizeVisitors, VisitorLevelContext } from '../src/visitors';
import { Oas3RuleSet } from '../src/validate';
import { Oas3RuleSet } from '../src/lint';
import { Oas3Types } from '../src/types/oas3';

@@ -4,0 +4,0 @@ import { normalizeTypes } from '../src/types';

import outdent from 'outdent';
import { parseYamlToDocument } from './utils';
import { parseRef } from '../src/ref-utils';
import { validateDocument } from '../src/validate';
import { lintDocument } from '../src/lint';
import { LintConfig } from '../src/config/config';

@@ -91,3 +90,3 @@ import { BaseResolver } from '../src/resolve';

const result = await validateDocument({
const result = await lintDocument({
document,

@@ -94,0 +93,0 @@ externalRefResolver: new BaseResolver(),

@@ -7,3 +7,3 @@ import * as yaml from 'js-yaml';

import { RuleConfig, LintConfig, Plugin } from '../src/config/config';
import { Oas3RuleSet } from '../src/validate';
import { Oas3RuleSet } from '../src/lint';

@@ -10,0 +10,0 @@ export function parseYamlToDocument(body: string, absoluteRef: string = ''): Document {

import outdent from 'outdent';
import * as path from 'path';
import { validateDocument, Oas3RuleSet } from '../src/validate';
import { lintDocument, Oas3RuleSet } from '../src/lint';

@@ -47,3 +47,3 @@ import { parseYamlToDocument, replaceSourceWithRef, makeConfigForRuleset } from './utils';

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -115,3 +115,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -201,3 +201,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -274,3 +274,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -347,3 +347,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -415,3 +415,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -470,3 +470,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -527,3 +527,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -570,3 +570,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -626,3 +626,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -713,3 +713,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -793,3 +793,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -866,3 +866,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -911,3 +911,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -977,3 +977,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -1066,3 +1066,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -1147,3 +1147,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -1256,3 +1256,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -1303,3 +1303,3 @@ document,

await validateDocument({
await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -1306,0 +1306,0 @@ document,

@@ -6,3 +6,3 @@ "use strict";

const path_1 = require("path");
const validate_1 = require("../../validate");
const lint_1 = require("../../lint");
const config_1 = require("../../config/config");

@@ -16,3 +16,3 @@ const resolve_1 = require("../../resolve");

function measureAsync() {
return validate_1.validateDocument({
return lint_1.lintDocument({
externalRefResolver: new resolve_1.BaseResolver(),

@@ -19,0 +19,0 @@ document: rebillyDocument,

import { Document } from '../resolve';
import { Oas3RuleSet } from '../validate';
import { Oas3RuleSet } from '../lint';
import { LintConfig, Plugin } from '../config/config';
export declare function parseYamlToDocument(body: string, absoluteRef?: string): Document;
export declare function makeConfigForRuleset(rules: Oas3RuleSet, plugin?: Partial<Plugin>): LintConfig;

@@ -20,3 +20,3 @@ "use strict";

const walk_1 = require("./walk");
const validate_1 = require("./validate");
const lint_1 = require("./lint");
const ref_utils_1 = require("./ref-utils");

@@ -42,6 +42,6 @@ const rules_1 = require("./config/rules");

const { document, config, customTypes, externalRefResolver, dereference = false } = opts;
const oasVersion = validate_1.detectOpenAPI(document.parsed);
const oasMajorVersion = validate_1.openAPIMajor(oasVersion);
const oasVersion = lint_1.detectOpenAPI(document.parsed);
const oasMajorVersion = lint_1.openAPIMajor(oasVersion);
const rules = config.getRulesForOasVersion(oasMajorVersion);
const types = types_1.normalizeTypes(config.extendTypes((customTypes !== null && customTypes !== void 0 ? customTypes : oasMajorVersion === validate_1.OasMajorVersion.Version3) ? oas3_1.Oas3Types : oas2_1.Oas2Types, oasVersion));
const types = types_1.normalizeTypes(config.extendTypes((customTypes !== null && customTypes !== void 0 ? customTypes : oasMajorVersion === lint_1.OasMajorVersion.Version3) ? oas3_1.Oas3Types : oas2_1.Oas2Types, oasVersion));
const preprocessors = rules_1.initRules(rules, config, 'preprocessors', oasVersion);

@@ -84,3 +84,3 @@ const decorators = rules_1.initRules(rules, config, 'decorators', oasVersion);

switch (version) {
case validate_1.OasMajorVersion.Version3:
case lint_1.OasMajorVersion.Version3:
switch (typeName) {

@@ -108,3 +108,3 @@ case 'Schema':

}
case validate_1.OasMajorVersion.Version2:
case lint_1.OasMajorVersion.Version2:
switch (typeName) {

@@ -160,6 +160,6 @@ case 'Schema':

enter(root) {
if (version === validate_1.OasMajorVersion.Version3) {
if (version === lint_1.OasMajorVersion.Version3) {
components = root.components = root.components || {};
}
else if (version === validate_1.OasMajorVersion.Version2) {
else if (version === lint_1.OasMajorVersion.Version2) {
components = root;

@@ -170,3 +170,3 @@ }

};
if (version === validate_1.OasMajorVersion.Version3) {
if (version === lint_1.OasMajorVersion.Version3) {
visitor.DiscriminatorMapping = {

@@ -196,3 +196,3 @@ leave(mapping, ctx) {

components[componentType][name] = target.node;
if (version === validate_1.OasMajorVersion.Version3) {
if (version === lint_1.OasMajorVersion.Version3) {
return `#/components/${componentType}/${name}`;

@@ -199,0 +199,0 @@ }

@@ -1,4 +0,4 @@

import { OasVersion, Oas3PreprocessorsSet, OasMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet } from '../validate';
import { OasVersion, Oas3PreprocessorsSet, OasMajorVersion, Oas3DecoratorsSet, Oas2RuleSet, Oas2PreprocessorsSet, Oas2DecoratorsSet } from '../lint';
import { ProblemSeverity, NormalizedProblem } from '../walk';
import { Oas3RuleSet } from '../validate';
import { Oas3RuleSet } from '../lint';
import { NodeType } from '../types';

@@ -5,0 +5,0 @@ export declare type RuleConfig = ProblemSeverity | 'off' | ({

@@ -21,3 +21,3 @@ "use strict";

const utils_1 = require("../utils");
const validate_1 = require("../validate");
const lint_1 = require("../lint");
const recommended_1 = require("./recommended");

@@ -58,12 +58,12 @@ const redocly_1 = require("../redocly");

this.rules = {
[validate_1.OasVersion.Version2]: Object.assign(Object.assign({}, merged.rules), merged.oas2Rules),
[validate_1.OasVersion.Version3_0]: Object.assign(Object.assign({}, merged.rules), merged.oas3_0Rules),
[lint_1.OasVersion.Version2]: Object.assign(Object.assign({}, merged.rules), merged.oas2Rules),
[lint_1.OasVersion.Version3_0]: Object.assign(Object.assign({}, merged.rules), merged.oas3_0Rules),
};
this.preprocessors = {
[validate_1.OasVersion.Version2]: Object.assign(Object.assign({}, merged.preprocessors), merged.oas2Preprocessors),
[validate_1.OasVersion.Version3_0]: Object.assign(Object.assign({}, merged.preprocessors), merged.oas3_0Preprocessors),
[lint_1.OasVersion.Version2]: Object.assign(Object.assign({}, merged.preprocessors), merged.oas2Preprocessors),
[lint_1.OasVersion.Version3_0]: Object.assign(Object.assign({}, merged.preprocessors), merged.oas3_0Preprocessors),
};
this.decorators = {
[validate_1.OasVersion.Version2]: Object.assign(Object.assign({}, merged.decorators), merged.oas2Decorators),
[validate_1.OasVersion.Version3_0]: Object.assign(Object.assign({}, merged.decorators), merged.oas3_0Decorators),
[lint_1.OasVersion.Version2]: Object.assign(Object.assign({}, merged.decorators), merged.oas2Decorators),
[lint_1.OasVersion.Version3_0]: Object.assign(Object.assign({}, merged.decorators), merged.oas3_0Decorators),
};

@@ -121,7 +121,7 @@ const dir = this.configFile ? path.dirname(this.configFile) : process.cwd();

switch (version) {
case validate_1.OasVersion.Version3_0:
case lint_1.OasVersion.Version3_0:
if (!plugin.typeExtension.oas3)
continue;
extendedTypes = plugin.typeExtension.oas3(extendedTypes, version);
case validate_1.OasVersion.Version2:
case lint_1.OasVersion.Version2:
if (!plugin.typeExtension.oas2)

@@ -193,3 +193,3 @@ continue;

switch (version) {
case validate_1.OasMajorVersion.Version3:
case lint_1.OasMajorVersion.Version3:
const oas3Rules = []; // default ruleset

@@ -200,3 +200,3 @@ this.plugins.forEach((p) => { var _a; return ((_a = p.preprocessors) === null || _a === void 0 ? void 0 : _a.oas3) && oas3Rules.push(p.preprocessors.oas3); });

return oas3Rules;
case validate_1.OasMajorVersion.Version2:
case lint_1.OasMajorVersion.Version2:
const oas2Rules = []; // default ruleset

@@ -211,3 +211,3 @@ this.plugins.forEach((p) => { var _a; return ((_a = p.preprocessors) === null || _a === void 0 ? void 0 : _a.oas2) && oas2Rules.push(p.preprocessors.oas2); });

for (const ruleId of rules || []) {
for (const version of Object.values(validate_1.OasVersion)) {
for (const version of Object.values(lint_1.OasVersion)) {
if (this.rules[version][ruleId]) {

@@ -221,3 +221,3 @@ this.rules[version][ruleId] = 'off';

for (const preprocessorId of preprocessors || []) {
for (const version of Object.values(validate_1.OasVersion)) {
for (const version of Object.values(lint_1.OasVersion)) {
if (this.preprocessors[version][preprocessorId]) {

@@ -231,3 +231,3 @@ this.preprocessors[version][preprocessorId] = 'off';

for (const decoratorId of decorators || []) {
for (const version of Object.values(validate_1.OasVersion)) {
for (const version of Object.values(lint_1.OasVersion)) {
if (this.decorators[version][decoratorId]) {

@@ -234,0 +234,0 @@ this.decorators[version][decoratorId] = 'off';

@@ -1,2 +0,2 @@

import { RuleSet, OasVersion } from '../validate';
import { RuleSet, OasVersion } from '../lint';
import { LintConfig } from './config';

@@ -3,0 +3,0 @@ export declare function initRules<T extends Function, P extends RuleSet<T>>(rules: P[], config: LintConfig, type: 'rules' | 'preprocessors' | 'decorators', oasVersion: OasVersion): {

@@ -13,7 +13,7 @@ export type { BundleOutputFormat } from './utils';

export { unescapePointer } from './ref-utils';
export { detectOpenAPI, OasMajorVersion, openAPIMajor } from './validate';
export { detectOpenAPI, OasMajorVersion, openAPIMajor } from './lint';
export { normalizeVisitors } from './visitors';
export { WalkContext, walkDocument, NormalizedProblem, ProblemSeverity, LineColLocationObject, LocationObject, Loc } from './walk';
export { formatProblems, OutputFormat } from './format/format';
export { OasVersion, validate, validateDocument } from './validate';
export { OasVersion, lint, lint as validate, lintDocument } from './lint';
export { bundle } from './bundle';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bundle = exports.validateDocument = exports.validate = exports.OasVersion = exports.formatProblems = exports.walkDocument = exports.normalizeVisitors = exports.openAPIMajor = exports.OasMajorVersion = exports.detectOpenAPI = exports.unescapePointer = exports.YamlParseError = exports.ResolveError = exports.resolveDocument = exports.BaseResolver = exports.RedoclyClient = exports.LintConfig = exports.Config = exports.loadConfig = exports.Stats = exports.normalizeTypes = exports.Oas2Types = exports.Oas3Types = void 0;
exports.bundle = exports.lintDocument = exports.validate = exports.lint = exports.OasVersion = exports.formatProblems = exports.walkDocument = exports.normalizeVisitors = exports.openAPIMajor = exports.OasMajorVersion = exports.detectOpenAPI = exports.unescapePointer = exports.YamlParseError = exports.ResolveError = exports.resolveDocument = exports.BaseResolver = exports.RedoclyClient = exports.LintConfig = exports.Config = exports.loadConfig = exports.Stats = exports.normalizeTypes = exports.Oas2Types = exports.Oas3Types = void 0;
var oas3_1 = require("./types/oas3");

@@ -25,6 +25,6 @@ Object.defineProperty(exports, "Oas3Types", { enumerable: true, get: function () { return oas3_1.Oas3Types; } });

Object.defineProperty(exports, "unescapePointer", { enumerable: true, get: function () { return ref_utils_1.unescapePointer; } });
var validate_1 = require("./validate");
Object.defineProperty(exports, "detectOpenAPI", { enumerable: true, get: function () { return validate_1.detectOpenAPI; } });
Object.defineProperty(exports, "OasMajorVersion", { enumerable: true, get: function () { return validate_1.OasMajorVersion; } });
Object.defineProperty(exports, "openAPIMajor", { enumerable: true, get: function () { return validate_1.openAPIMajor; } });
var lint_1 = require("./lint");
Object.defineProperty(exports, "detectOpenAPI", { enumerable: true, get: function () { return lint_1.detectOpenAPI; } });
Object.defineProperty(exports, "OasMajorVersion", { enumerable: true, get: function () { return lint_1.OasMajorVersion; } });
Object.defineProperty(exports, "openAPIMajor", { enumerable: true, get: function () { return lint_1.openAPIMajor; } });
var visitors_1 = require("./visitors");

@@ -36,7 +36,8 @@ Object.defineProperty(exports, "normalizeVisitors", { enumerable: true, get: function () { return visitors_1.normalizeVisitors; } });

Object.defineProperty(exports, "formatProblems", { enumerable: true, get: function () { return format_1.formatProblems; } });
var validate_2 = require("./validate");
Object.defineProperty(exports, "OasVersion", { enumerable: true, get: function () { return validate_2.OasVersion; } });
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_2.validate; } });
Object.defineProperty(exports, "validateDocument", { enumerable: true, get: function () { return validate_2.validateDocument; } });
var lint_2 = require("./lint");
Object.defineProperty(exports, "OasVersion", { enumerable: true, get: function () { return lint_2.OasVersion; } });
Object.defineProperty(exports, "lint", { enumerable: true, get: function () { return lint_2.lint; } });
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return lint_2.lint; } });
Object.defineProperty(exports, "lintDocument", { enumerable: true, get: function () { return lint_2.lintDocument; } });
var bundle_1 = require("./bundle");
Object.defineProperty(exports, "bundle", { enumerable: true, get: function () { return bundle_1.bundle; } });

@@ -5,3 +5,3 @@ import { Referenced } from './typings/openapi';

import { ResolvedRefMap, Document, ResolveError, YamlParseError, Source } from './resolve';
import { OasVersion } from './validate';
import { OasVersion } from './lint';
import { NormalizedNodeType } from './types';

@@ -8,0 +8,0 @@ declare type NonUndefined = string | number | boolean | symbol | bigint | object | Record<string, any>;

{
"name": "@redocly/openapi-core",
"version": "1.0.0-beta.22",
"version": "1.0.0-beta.23",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

import { readFileSync } from 'fs';
import { join as pathJoin, resolve as pathResolve } from 'path';
import { validateDocument } from '../../validate';
import { lintDocument } from '../../lint';
import { LintConfig } from '../../config/config';

@@ -17,3 +17,3 @@ import { BaseResolver } from '../../resolve';

export function measureAsync() {
return validateDocument({
return lintDocument({
externalRefResolver: new BaseResolver(),

@@ -20,0 +20,0 @@ document: rebillyDocument,

import * as yaml from 'js-yaml';
import { Document, Source } from '../resolve';
import { Oas3RuleSet } from '../validate';
import { Oas3RuleSet } from '../lint';
import { RuleConfig, LintConfig, Plugin } from '../config/config';

@@ -5,0 +5,0 @@

@@ -8,3 +8,3 @@ import isEqual = require('lodash.isequal');

import { WalkContext, walkDocument, UserContext } from './walk';
import { detectOpenAPI, openAPIMajor, OasMajorVersion } from './validate';
import { detectOpenAPI, openAPIMajor, OasMajorVersion } from './lint';
import { Location, refBaseName } from './ref-utils';

@@ -11,0 +11,0 @@ import { Config, LintConfig } from './config/config';

@@ -18,6 +18,6 @@ import * as fs from 'fs';

Oas2DecoratorsSet,
} from '../validate';
} from '../lint';
import { ProblemSeverity, NormalizedProblem } from '../walk';
import { Oas3RuleSet } from '../validate';
import { Oas3RuleSet } from '../lint';

@@ -24,0 +24,0 @@ import recommended from './recommended';

@@ -1,2 +0,2 @@

import { RuleSet, OasVersion } from '../validate';
import { RuleSet, OasVersion } from '../lint';
import { LintConfig } from './config';

@@ -3,0 +3,0 @@ import { notUndefined } from '../utils';

@@ -14,3 +14,3 @@ export type { BundleOutputFormat } from './utils';

export { unescapePointer } from './ref-utils';
export { detectOpenAPI, OasMajorVersion, openAPIMajor } from './validate';
export { detectOpenAPI, OasMajorVersion, openAPIMajor } from './lint';
export { normalizeVisitors } from './visitors';

@@ -20,4 +20,3 @@ export { WalkContext, walkDocument, NormalizedProblem, ProblemSeverity, LineColLocationObject, LocationObject, Loc } from './walk';

export { formatProblems, OutputFormat } from './format/format';
export { OasVersion, validate, validateDocument } from './validate';
export { OasVersion, lint, lint as validate, lintDocument } from './lint';
export { bundle } from './bundle';
import path = require('path');
import { outdent } from 'outdent';
import { validateDocument } from '../../validate';
import { lintDocument } from '../../lint';
import { LintConfig } from '../..';

@@ -24,3 +24,3 @@ import { BaseResolver } from '../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -68,3 +68,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -129,3 +129,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -157,3 +157,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -160,0 +160,0 @@ document,

import { outdent } from 'outdent';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -19,3 +18,3 @@ import { LintConfig } from '../../../config/config';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -61,3 +60,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -102,3 +101,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -105,0 +104,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -20,3 +18,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -58,3 +56,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -61,0 +59,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -21,3 +19,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -59,3 +57,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -62,0 +60,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -49,3 +47,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -52,0 +50,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -32,3 +30,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -63,3 +61,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -66,0 +64,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -37,3 +35,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -40,0 +38,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -22,3 +20,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -60,3 +58,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -82,3 +80,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -85,0 +83,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -24,3 +22,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -64,3 +62,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -88,3 +86,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -91,0 +89,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -29,3 +27,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -72,3 +70,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -75,0 +73,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -24,3 +22,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -27,0 +25,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -25,3 +23,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -72,3 +70,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -106,3 +104,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -158,3 +156,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -161,0 +159,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -22,3 +20,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -65,3 +63,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -68,0 +66,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -27,3 +25,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -68,3 +66,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -71,0 +69,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -26,3 +24,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -91,3 +89,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -94,0 +92,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -22,3 +20,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -60,3 +58,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -63,0 +61,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -27,3 +25,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -56,3 +54,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -101,3 +99,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -104,0 +102,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -25,3 +23,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -28,0 +26,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -22,3 +20,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -61,3 +59,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -64,0 +62,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -22,3 +20,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -60,3 +58,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -63,0 +61,0 @@ document,

import { outdent } from 'outdent';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { LintConfig } from '../../..';

@@ -23,3 +22,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -76,3 +75,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -101,3 +100,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -104,0 +103,0 @@ document,

import { outdent } from 'outdent';
import { validateDoc } from './utils';
import { lintDoc } from './utils';

@@ -21,3 +21,3 @@ describe('OpenAPI Schema 2.0', () => {

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -52,3 +52,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -83,3 +83,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -118,3 +118,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -145,3 +145,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -179,3 +179,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -212,3 +212,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -237,3 +237,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -270,3 +270,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -302,3 +302,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -324,3 +324,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -354,3 +354,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -357,0 +357,0 @@ }),

import { outdent } from 'outdent';
import { validateDoc } from './utils';
import { lintDoc } from './utils';

@@ -21,3 +21,3 @@ describe('OpenAPI Schema 2.0', () => {

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -49,3 +49,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -84,3 +84,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -121,3 +121,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -124,0 +124,0 @@ }),

import { outdent } from 'outdent';
import { validateDoc } from './utils';
import { lintDoc } from './utils';

@@ -21,3 +21,3 @@ describe('OpenAPI Schema', () => {

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -39,3 +39,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -55,3 +55,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -80,3 +80,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -104,3 +104,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -139,3 +139,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
'paths-identical': 'error',

@@ -167,3 +167,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -195,3 +195,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -214,3 +214,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -249,3 +249,3 @@ }),

expect(
await validateDoc(source, {
await lintDoc(source, {
spec: 'error',

@@ -252,0 +252,0 @@ }),

import { outdent } from 'outdent';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../../__tests__/utils';
import { validateDocument } from '../../../../validate';
import { lintDocument } from '../../../../lint';
import { LintConfig } from '../../../..';

@@ -24,3 +22,3 @@ import { BaseResolver } from '../../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -27,0 +25,0 @@ document,

import { LintConfig, RuleConfig } from '../../../../config/config';
import { parseYamlToDocument } from '../../../../../__tests__/utils';
import { validateDocument } from '../../../../validate';
import { lintDocument } from '../../../../lint';
import { BaseResolver } from '../../../../resolve';
export async function validateDoc(
export async function lintDoc(
source: string,

@@ -12,3 +12,3 @@ rules: Record<string, RuleConfig> = { spec: 'error' },

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -15,0 +15,0 @@ document,

import { outdent } from 'outdent';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { LintConfig } from '../../..';

@@ -24,3 +23,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -77,3 +76,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -102,3 +101,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -105,0 +104,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -23,3 +21,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -64,3 +62,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -67,0 +65,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -36,3 +34,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -110,3 +108,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -174,3 +172,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -228,3 +226,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -285,3 +283,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -318,3 +316,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -321,0 +319,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -20,3 +18,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -56,3 +54,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -59,0 +57,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -20,3 +18,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -56,3 +54,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -59,0 +57,0 @@ document,

import { outdent } from 'outdent';
import { LintConfig } from '../../../config/config';
import { validateDocument } from '../../../validate';
import { lintDocument } from '../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../__tests__/utils';

@@ -45,3 +43,3 @@ import { BaseResolver } from '../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -48,0 +46,0 @@ document,

import { outdent } from 'outdent';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../../__tests__/utils';
import { validateDocument } from '../../../../validate';
import { lintDocument } from '../../../../lint';
import { LintConfig } from '../../../..';

@@ -24,3 +22,3 @@ import { BaseResolver } from '../../../../resolve';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -27,0 +25,0 @@ document,

import { outdent } from 'outdent';
import { validateDocument } from '../../../../validate';
import { lintDocument } from '../../../../lint';
import { parseYamlToDocument, replaceSourceWithRef } from '../../../../../__tests__/utils';

@@ -40,3 +39,3 @@ import { LintConfig } from '../../../../config/config';

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -169,3 +168,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -239,3 +238,3 @@ document,

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -242,0 +241,0 @@ document,

import { LintConfig, RuleConfig } from '../../../../config/config';
import { parseYamlToDocument } from '../../../../../__tests__/utils';
import { validateDocument } from '../../../../validate';
import { lintDocument } from '../../../../lint';
import { BaseResolver } from '../../../../resolve';

@@ -12,3 +12,3 @@

const results = await validateDocument({
const results = await lintDocument({
externalRefResolver: new BaseResolver(),

@@ -15,0 +15,0 @@ document,

@@ -1,2 +0,2 @@

import { Oas3RuleSet } from '../../validate';
import { Oas3RuleSet } from '../../lint';

@@ -3,0 +3,0 @@ import { OasSpec } from '../common/spec';

@@ -13,3 +13,3 @@ import { Referenced } from './typings/openapi';

import { pushStack, popStack } from './utils';
import { OasVersion } from './validate';
import { OasVersion } from './lint';
import { NormalizedNodeType, isNamedType } from './types';

@@ -16,0 +16,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc