@redocly/openapi-core 1.0.0-beta.125 → 1.0.0-beta.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundle.js +5 -2
- package/lib/config/all.js +8 -1
- package/lib/resolve.js +5 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +1 -1
- package/lib/rules/common/required-string-property-missing-min-length.js +3 -3
- package/lib/rules/common/spec.js +1 -0
- package/lib/rules/oas2/index.js +1 -1
- package/lib/rules/oas2/request-mime-type.d.ts +1 -1
- package/lib/rules/oas2/response-mime-type.d.ts +1 -1
- package/lib/rules/oas3/index.js +1 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +2 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
- package/lib/rules/oas3/request-mime-type.d.ts +1 -1
- package/lib/rules/oas3/response-mime-type.d.ts +1 -1
- package/lib/walk.d.ts +6 -5
- package/lib/walk.js +23 -27
- package/package.json +1 -1
- package/__tests__/utils.ts +0 -88
- package/src/__tests__/__snapshots__/bundle.test.ts.snap +0 -437
- package/src/__tests__/bundle.test.ts +0 -236
- package/src/__tests__/codeframes.test.ts +0 -530
- package/src/__tests__/fixtures/.redocly.lint-ignore.yaml +0 -5
- package/src/__tests__/fixtures/extension.js +0 -24
- package/src/__tests__/fixtures/refs/definitions.yaml +0 -3
- package/src/__tests__/fixtures/refs/examples.yaml +0 -8
- package/src/__tests__/fixtures/refs/external-request-body.yaml +0 -13
- package/src/__tests__/fixtures/refs/externalref.yaml +0 -35
- package/src/__tests__/fixtures/refs/hosted.yaml +0 -35
- package/src/__tests__/fixtures/refs/openapi-with-external-refs-conflicting-names.yaml +0 -21
- package/src/__tests__/fixtures/refs/openapi-with-external-refs.yaml +0 -33
- package/src/__tests__/fixtures/refs/openapi-with-url-refs.yaml +0 -18
- package/src/__tests__/fixtures/refs/param-b.yaml +0 -1
- package/src/__tests__/fixtures/refs/param-c.yaml +0 -1
- package/src/__tests__/fixtures/refs/rename.yaml +0 -1
- package/src/__tests__/fixtures/refs/requestBody.yaml +0 -9
- package/src/__tests__/fixtures/refs/schema-a.yaml +0 -1
- package/src/__tests__/fixtures/refs/simple.yaml +0 -1
- package/src/__tests__/fixtures/refs/vendor.schema.yaml +0 -20
- package/src/__tests__/fixtures/resolve/External.yaml +0 -10
- package/src/__tests__/fixtures/resolve/External2.yaml +0 -4
- package/src/__tests__/fixtures/resolve/description.md +0 -3
- package/src/__tests__/fixtures/resolve/externalInfo.yaml +0 -4
- package/src/__tests__/fixtures/resolve/externalLicense.yaml +0 -1
- package/src/__tests__/fixtures/resolve/openapi-with-back.yaml +0 -13
- package/src/__tests__/fixtures/resolve/openapi-with-md-description.yaml +0 -5
- package/src/__tests__/fixtures/resolve/openapi.yaml +0 -28
- package/src/__tests__/fixtures/resolve/schemas/type-a.yaml +0 -10
- package/src/__tests__/fixtures/resolve/schemas/type-b.yaml +0 -6
- package/src/__tests__/fixtures/resolve/transitive/a.yaml +0 -1
- package/src/__tests__/fixtures/resolve/transitive/components.yaml +0 -5
- package/src/__tests__/fixtures/resolve/transitive/schemas.yaml +0 -3
- package/src/__tests__/format.test.ts +0 -76
- package/src/__tests__/js-yaml.test.ts +0 -73
- package/src/__tests__/lint.test.ts +0 -388
- package/src/__tests__/logger-browser.test.ts +0 -53
- package/src/__tests__/logger.test.ts +0 -47
- package/src/__tests__/login.test.ts +0 -17
- package/src/__tests__/normalizeVisitors.test.ts +0 -151
- package/src/__tests__/output-browser.test.ts +0 -18
- package/src/__tests__/output.test.ts +0 -15
- package/src/__tests__/ref-utils.test.ts +0 -120
- package/src/__tests__/resolve-http.test.ts +0 -77
- package/src/__tests__/resolve.test.ts +0 -408
- package/src/__tests__/utils-browser.test.ts +0 -11
- package/src/__tests__/utils.test.ts +0 -144
- package/src/__tests__/walk.test.ts +0 -1545
- package/src/benchmark/benches/lint-with-many-rules.bench.ts +0 -35
- package/src/benchmark/benches/lint-with-nested-rule.bench.ts +0 -39
- package/src/benchmark/benches/lint-with-no-rules.bench.ts +0 -20
- package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +0 -35
- package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +0 -32
- package/src/benchmark/benches/rebilly.yaml +0 -32275
- package/src/benchmark/benches/recommended-oas3.bench.ts +0 -22
- package/src/benchmark/benches/resolve-with-no-external.bench.ts +0 -23
- package/src/benchmark/benchmark.js +0 -311
- package/src/benchmark/colors.js +0 -29
- package/src/benchmark/fork.js +0 -83
- package/src/benchmark/utils.ts +0 -36
- package/src/bundle.ts +0 -399
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +0 -161
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +0 -144
- package/src/config/__tests__/config-resolvers.test.ts +0 -491
- package/src/config/__tests__/config.test.ts +0 -307
- package/src/config/__tests__/fixtures/ingore-file.ts +0 -8
- package/src/config/__tests__/fixtures/load-redocly.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin-config.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin.js +0 -56
- package/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml +0 -11
- package/src/config/__tests__/fixtures/resolve-config/api/plugin.js +0 -69
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml +0 -7
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-custom-function.yaml +0 -17
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml +0 -18
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-wrong-custom-function.yaml +0 -15
- package/src/config/__tests__/fixtures/resolve-config/local-config.yaml +0 -9
- package/src/config/__tests__/fixtures/resolve-config/plugin.js +0 -80
- package/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml +0 -3
- package/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml +0 -4
- package/src/config/__tests__/load.test.ts +0 -167
- package/src/config/__tests__/resolve-plugins.test.ts +0 -27
- package/src/config/__tests__/utils.test.ts +0 -204
- package/src/config/all.ts +0 -66
- package/src/config/builtIn.ts +0 -37
- package/src/config/config-resolvers.ts +0 -465
- package/src/config/config.ts +0 -330
- package/src/config/index.ts +0 -7
- package/src/config/load.ts +0 -144
- package/src/config/minimal.ts +0 -60
- package/src/config/recommended.ts +0 -60
- package/src/config/rules.ts +0 -54
- package/src/config/types.ts +0 -216
- package/src/config/utils.ts +0 -333
- package/src/decorators/__tests__/filter-in.test.ts +0 -310
- package/src/decorators/__tests__/filter-out.test.ts +0 -335
- package/src/decorators/__tests__/media-type-examples-override.test.ts +0 -665
- package/src/decorators/__tests__/remove-x-internal.test.ts +0 -316
- package/src/decorators/__tests__/resources/request.yaml +0 -3
- package/src/decorators/__tests__/resources/response.yaml +0 -3
- package/src/decorators/common/filters/filter-helper.ts +0 -72
- package/src/decorators/common/filters/filter-in.ts +0 -18
- package/src/decorators/common/filters/filter-out.ts +0 -18
- package/src/decorators/common/info-description-override.ts +0 -24
- package/src/decorators/common/info-override.ts +0 -15
- package/src/decorators/common/media-type-examples-override.ts +0 -79
- package/src/decorators/common/operation-description-override.ts +0 -30
- package/src/decorators/common/registry-dependencies.ts +0 -25
- package/src/decorators/common/remove-x-internal.ts +0 -59
- package/src/decorators/common/tag-description-override.ts +0 -25
- package/src/decorators/oas2/index.ts +0 -20
- package/src/decorators/oas3/index.ts +0 -22
- package/src/env.ts +0 -5
- package/src/format/codeframes.ts +0 -216
- package/src/format/format.ts +0 -375
- package/src/index.ts +0 -71
- package/src/js-yaml/index.ts +0 -14
- package/src/lint.ts +0 -130
- package/src/logger.ts +0 -34
- package/src/oas-types.ts +0 -57
- package/src/output.ts +0 -7
- package/src/redocly/__tests__/redocly-client.test.ts +0 -146
- package/src/redocly/index.ts +0 -187
- package/src/redocly/redocly-client-types.ts +0 -10
- package/src/redocly/registry-api-types.ts +0 -32
- package/src/redocly/registry-api.ts +0 -149
- package/src/ref-utils.ts +0 -85
- package/src/resolve.ts +0 -412
- package/src/rules/__tests__/fixtures/code-sample.php +0 -9
- package/src/rules/__tests__/fixtures/invalid-yaml.yaml +0 -1
- package/src/rules/__tests__/fixtures/ref.yaml +0 -1
- package/src/rules/__tests__/no-unresolved-refs.test.ts +0 -257
- package/src/rules/__tests__/utils.test.ts +0 -160
- package/src/rules/ajv.ts +0 -102
- package/src/rules/common/__tests__/info-license.test.ts +0 -62
- package/src/rules/common/__tests__/license-url.test.ts +0 -63
- package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +0 -96
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +0 -210
- package/src/rules/common/__tests__/no-identical-paths.test.ts +0 -58
- package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +0 -85
- package/src/rules/common/__tests__/operation-2xx-response.test.ts +0 -192
- package/src/rules/common/__tests__/operation-4xx-response.test.ts +0 -231
- package/src/rules/common/__tests__/operation-operationId-unique.test.ts +0 -76
- package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +0 -45
- package/src/rules/common/__tests__/operation-parameters-unique.test.ts +0 -167
- package/src/rules/common/__tests__/operation-singular-tag.test.ts +0 -72
- package/src/rules/common/__tests__/path-http-verbs-order.test.ts +0 -95
- package/src/rules/common/__tests__/path-not-include-query.test.ts +0 -64
- package/src/rules/common/__tests__/path-params-defined.test.ts +0 -202
- package/src/rules/common/__tests__/paths-kebab-case.test.ts +0 -108
- package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +0 -264
- package/src/rules/common/__tests__/security-defined.test.ts +0 -175
- package/src/rules/common/__tests__/spec.test.ts +0 -555
- package/src/rules/common/__tests__/tag-description.test.ts +0 -65
- package/src/rules/common/__tests__/tags-alphabetical.test.ts +0 -64
- package/src/rules/common/assertions/__tests__/asserts.test.ts +0 -869
- package/src/rules/common/assertions/__tests__/index.test.ts +0 -100
- package/src/rules/common/assertions/__tests__/utils.test.ts +0 -236
- package/src/rules/common/assertions/asserts.ts +0 -357
- package/src/rules/common/assertions/index.ts +0 -56
- package/src/rules/common/assertions/utils.ts +0 -331
- package/src/rules/common/info-contact.ts +0 -15
- package/src/rules/common/info-license-url.ts +0 -10
- package/src/rules/common/info-license.ts +0 -15
- package/src/rules/common/no-ambiguous-paths.ts +0 -50
- package/src/rules/common/no-enum-type-mismatch.ts +0 -52
- package/src/rules/common/no-http-verbs-in-paths.ts +0 -36
- package/src/rules/common/no-identical-paths.ts +0 -24
- package/src/rules/common/no-invalid-parameter-examples.ts +0 -36
- package/src/rules/common/no-invalid-schema-examples.ts +0 -27
- package/src/rules/common/no-path-trailing-slash.ts +0 -15
- package/src/rules/common/operation-2xx-response.ts +0 -24
- package/src/rules/common/operation-4xx-response.ts +0 -24
- package/src/rules/common/operation-description.ts +0 -13
- package/src/rules/common/operation-operationId-unique.ts +0 -21
- package/src/rules/common/operation-operationId-url-safe.ts +0 -19
- package/src/rules/common/operation-operationId.ts +0 -17
- package/src/rules/common/operation-parameters-unique.ts +0 -48
- package/src/rules/common/operation-singular-tag.ts +0 -17
- package/src/rules/common/operation-summary.ts +0 -13
- package/src/rules/common/operation-tag-defined.ts +0 -26
- package/src/rules/common/parameter-description.ts +0 -22
- package/src/rules/common/path-declaration-must-exist.ts +0 -15
- package/src/rules/common/path-excludes-patterns.ts +0 -23
- package/src/rules/common/path-http-verbs-order.ts +0 -30
- package/src/rules/common/path-not-include-query.ts +0 -17
- package/src/rules/common/path-params-defined.ts +0 -65
- package/src/rules/common/path-segment-plural.ts +0 -31
- package/src/rules/common/paths-kebab-case.ts +0 -19
- package/src/rules/common/required-string-property-missing-min-length.ts +0 -44
- package/src/rules/common/response-contains-header.ts +0 -35
- package/src/rules/common/scalar-property-missing-example.ts +0 -58
- package/src/rules/common/security-defined.ts +0 -65
- package/src/rules/common/spec.ts +0 -174
- package/src/rules/common/tag-description.ts +0 -10
- package/src/rules/common/tags-alphabetical.ts +0 -20
- package/src/rules/no-unresolved-refs.ts +0 -51
- package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +0 -110
- package/src/rules/oas2/__tests__/response-contains-header.test.ts +0 -174
- package/src/rules/oas2/__tests__/response-contains-property.test.ts +0 -155
- package/src/rules/oas2/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas2/__tests__/spec/info.test.ts +0 -355
- package/src/rules/oas2/__tests__/spec/operation.test.ts +0 -123
- package/src/rules/oas2/__tests__/spec/paths.test.ts +0 -245
- package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +0 -35
- package/src/rules/oas2/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas2/boolean-parameter-prefixes.ts +0 -26
- package/src/rules/oas2/index.ts +0 -89
- package/src/rules/oas2/remove-unused-components.ts +0 -81
- package/src/rules/oas2/request-mime-type.ts +0 -17
- package/src/rules/oas2/response-contains-property.ts +0 -36
- package/src/rules/oas2/response-mime-type.ts +0 -17
- package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +0 -111
- package/src/rules/oas3/__tests__/fixtures/common.yaml +0 -11
- package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +0 -205
- package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +0 -65
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +0 -473
- package/src/rules/oas3/__tests__/no-server-example.com.test.ts +0 -60
- package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +0 -79
- package/src/rules/oas3/__tests__/no-unused-components.test.ts +0 -131
- package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +0 -145
- package/src/rules/oas3/__tests__/response-contains-header.test.ts +0 -389
- package/src/rules/oas3/__tests__/response-contains-property.test.ts +0 -403
- package/src/rules/oas3/__tests__/spec/callbacks.test.ts +0 -41
- package/src/rules/oas3/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas3/__tests__/spec/info.test.ts +0 -391
- package/src/rules/oas3/__tests__/spec/operation.test.ts +0 -253
- package/src/rules/oas3/__tests__/spec/paths.test.ts +0 -284
- package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +0 -77
- package/src/rules/oas3/__tests__/spec/servers.test.ts +0 -505
- package/src/rules/oas3/__tests__/spec/spec.test.ts +0 -298
- package/src/rules/oas3/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +0 -305
- package/src/rules/oas3/boolean-parameter-prefixes.ts +0 -28
- package/src/rules/oas3/index.ts +0 -109
- package/src/rules/oas3/no-empty-servers.ts +0 -22
- package/src/rules/oas3/no-example-value-and-externalValue.ts +0 -14
- package/src/rules/oas3/no-invalid-media-type-examples.ts +0 -49
- package/src/rules/oas3/no-server-example.com.ts +0 -14
- package/src/rules/oas3/no-server-trailing-slash.ts +0 -15
- package/src/rules/oas3/no-server-variables-empty-enum.ts +0 -66
- package/src/rules/oas3/no-undefined-server-variable.ts +0 -30
- package/src/rules/oas3/no-unused-components.ts +0 -75
- package/src/rules/oas3/operation-4xx-problem-details-rfc7807.ts +0 -36
- package/src/rules/oas3/remove-unused-components.ts +0 -95
- package/src/rules/oas3/request-mime-type.ts +0 -31
- package/src/rules/oas3/response-contains-property.ts +0 -38
- package/src/rules/oas3/response-mime-type.ts +0 -31
- package/src/rules/oas3/spec-components-invalid-map-name.ts +0 -74
- package/src/rules/other/stats.ts +0 -73
- package/src/rules/utils.ts +0 -191
- package/src/types/index.ts +0 -149
- package/src/types/oas2.ts +0 -478
- package/src/types/oas3.ts +0 -597
- package/src/types/oas3_1.ts +0 -258
- package/src/types/redocly-yaml.ts +0 -1010
- package/src/typings/common.ts +0 -17
- package/src/typings/openapi.ts +0 -298
- package/src/typings/swagger.ts +0 -236
- package/src/utils.ts +0 -276
- package/src/visitors.ts +0 -491
- package/src/walk.ts +0 -453
- package/tsconfig.json +0 -8
- package/tsconfig.tsbuildinfo +0 -1
package/src/bundle.ts
DELETED
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
import isEqual = require('lodash.isequal');
|
|
2
|
-
import { BaseResolver, resolveDocument, Document, ResolvedRefMap, makeRefId } from './resolve';
|
|
3
|
-
import { Oas3Rule, normalizeVisitors, Oas3Visitor, Oas2Visitor } from './visitors';
|
|
4
|
-
import { Oas3Types } from './types/oas3';
|
|
5
|
-
import { Oas2Types } from './types/oas2';
|
|
6
|
-
import { Oas3_1Types } from './types/oas3_1';
|
|
7
|
-
import { NormalizedNodeType, normalizeTypes, NodeType } from './types';
|
|
8
|
-
import { WalkContext, walkDocument, UserContext, ResolveResult, NormalizedProblem } from './walk';
|
|
9
|
-
import { detectOpenAPI, openAPIMajor, OasMajorVersion } from './oas-types';
|
|
10
|
-
import { isAbsoluteUrl, isRef, Location, refBaseName } from './ref-utils';
|
|
11
|
-
import { initRules } from './config/rules';
|
|
12
|
-
import { reportUnresolvedRef } from './rules/no-unresolved-refs';
|
|
13
|
-
import { isPlainObject, isTruthy } from './utils';
|
|
14
|
-
import { OasRef } from './typings/openapi';
|
|
15
|
-
import { isRedoclyRegistryURL } from './redocly';
|
|
16
|
-
import { RemoveUnusedComponents as RemoveUnusedComponentsOas2 } from './rules/oas2/remove-unused-components';
|
|
17
|
-
import { RemoveUnusedComponents as RemoveUnusedComponentsOas3 } from './rules/oas3/remove-unused-components';
|
|
18
|
-
|
|
19
|
-
import type { Config, StyleguideConfig } from './config';
|
|
20
|
-
|
|
21
|
-
export type Oas3RuleSet = Record<string, Oas3Rule>;
|
|
22
|
-
|
|
23
|
-
export enum OasVersion {
|
|
24
|
-
Version2 = 'oas2',
|
|
25
|
-
Version3_0 = 'oas3_0',
|
|
26
|
-
Version3_1 = 'oas3_1',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function bundle(opts: {
|
|
30
|
-
ref?: string;
|
|
31
|
-
doc?: Document;
|
|
32
|
-
externalRefResolver?: BaseResolver;
|
|
33
|
-
config: Config;
|
|
34
|
-
dereference?: boolean;
|
|
35
|
-
base?: string;
|
|
36
|
-
skipRedoclyRegistryRefs?: boolean;
|
|
37
|
-
removeUnusedComponents?: boolean;
|
|
38
|
-
keepUrlRefs?: boolean;
|
|
39
|
-
}) {
|
|
40
|
-
const {
|
|
41
|
-
ref,
|
|
42
|
-
doc,
|
|
43
|
-
externalRefResolver = new BaseResolver(opts.config.resolve),
|
|
44
|
-
base = null,
|
|
45
|
-
} = opts;
|
|
46
|
-
if (!(ref || doc)) {
|
|
47
|
-
throw new Error('Document or reference is required.\n');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const document =
|
|
51
|
-
doc !== undefined ? doc : await externalRefResolver.resolveDocument(base, ref!, true);
|
|
52
|
-
|
|
53
|
-
if (document instanceof Error) {
|
|
54
|
-
throw document;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return bundleDocument({
|
|
58
|
-
document,
|
|
59
|
-
...opts,
|
|
60
|
-
config: opts.config.styleguide,
|
|
61
|
-
externalRefResolver,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
type BundleContext = WalkContext;
|
|
66
|
-
|
|
67
|
-
export type BundleResult = {
|
|
68
|
-
bundle: Document;
|
|
69
|
-
problems: NormalizedProblem[];
|
|
70
|
-
fileDependencies: Set<string>;
|
|
71
|
-
rootType: NormalizedNodeType;
|
|
72
|
-
refTypes?: Map<string, NormalizedNodeType>;
|
|
73
|
-
visitorsData: Record<string, Record<string, unknown>>;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export async function bundleDocument(opts: {
|
|
77
|
-
document: Document;
|
|
78
|
-
config: StyleguideConfig;
|
|
79
|
-
customTypes?: Record<string, NodeType>;
|
|
80
|
-
externalRefResolver: BaseResolver;
|
|
81
|
-
dereference?: boolean;
|
|
82
|
-
skipRedoclyRegistryRefs?: boolean;
|
|
83
|
-
removeUnusedComponents?: boolean;
|
|
84
|
-
keepUrlRefs?: boolean;
|
|
85
|
-
}): Promise<BundleResult> {
|
|
86
|
-
const {
|
|
87
|
-
document,
|
|
88
|
-
config,
|
|
89
|
-
customTypes,
|
|
90
|
-
externalRefResolver,
|
|
91
|
-
dereference = false,
|
|
92
|
-
skipRedoclyRegistryRefs = false,
|
|
93
|
-
removeUnusedComponents = false,
|
|
94
|
-
keepUrlRefs = false,
|
|
95
|
-
} = opts;
|
|
96
|
-
const oasVersion = detectOpenAPI(document.parsed);
|
|
97
|
-
const oasMajorVersion = openAPIMajor(oasVersion);
|
|
98
|
-
const rules = config.getRulesForOasVersion(oasMajorVersion);
|
|
99
|
-
const types = normalizeTypes(
|
|
100
|
-
config.extendTypes(
|
|
101
|
-
customTypes ?? oasMajorVersion === OasMajorVersion.Version3
|
|
102
|
-
? oasVersion === OasVersion.Version3_1
|
|
103
|
-
? Oas3_1Types
|
|
104
|
-
: Oas3Types
|
|
105
|
-
: Oas2Types,
|
|
106
|
-
oasVersion
|
|
107
|
-
),
|
|
108
|
-
config
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const preprocessors = initRules(rules as any, config, 'preprocessors', oasVersion);
|
|
112
|
-
const decorators = initRules(rules as any, config, 'decorators', oasVersion);
|
|
113
|
-
|
|
114
|
-
const ctx: BundleContext = {
|
|
115
|
-
problems: [],
|
|
116
|
-
oasVersion: oasVersion,
|
|
117
|
-
refTypes: new Map<string, NormalizedNodeType>(),
|
|
118
|
-
visitorsData: {},
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
if (removeUnusedComponents) {
|
|
122
|
-
decorators.push({
|
|
123
|
-
severity: 'error',
|
|
124
|
-
ruleId: 'remove-unused-components',
|
|
125
|
-
visitor:
|
|
126
|
-
oasMajorVersion === OasMajorVersion.Version2
|
|
127
|
-
? RemoveUnusedComponentsOas2({})
|
|
128
|
-
: RemoveUnusedComponentsOas3({}),
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const resolvedRefMap = await resolveDocument({
|
|
133
|
-
rootDocument: document,
|
|
134
|
-
rootType: types.Root,
|
|
135
|
-
externalRefResolver,
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
const bundleVisitor = normalizeVisitors(
|
|
139
|
-
[
|
|
140
|
-
...preprocessors,
|
|
141
|
-
{
|
|
142
|
-
severity: 'error',
|
|
143
|
-
ruleId: 'bundler',
|
|
144
|
-
visitor: makeBundleVisitor(
|
|
145
|
-
oasMajorVersion,
|
|
146
|
-
dereference,
|
|
147
|
-
skipRedoclyRegistryRefs,
|
|
148
|
-
document,
|
|
149
|
-
resolvedRefMap,
|
|
150
|
-
keepUrlRefs
|
|
151
|
-
),
|
|
152
|
-
},
|
|
153
|
-
...decorators,
|
|
154
|
-
] as any,
|
|
155
|
-
types
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
walkDocument({
|
|
159
|
-
document,
|
|
160
|
-
rootType: types.Root as NormalizedNodeType,
|
|
161
|
-
normalizedVisitors: bundleVisitor,
|
|
162
|
-
resolvedRefMap,
|
|
163
|
-
ctx,
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
return {
|
|
167
|
-
bundle: document,
|
|
168
|
-
problems: ctx.problems.map((problem) => config.addProblemToIgnore(problem)),
|
|
169
|
-
fileDependencies: externalRefResolver.getFiles(),
|
|
170
|
-
rootType: types.Root,
|
|
171
|
-
refTypes: ctx.refTypes,
|
|
172
|
-
visitorsData: ctx.visitorsData,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export function mapTypeToComponent(typeName: string, version: OasMajorVersion) {
|
|
177
|
-
switch (version) {
|
|
178
|
-
case OasMajorVersion.Version3:
|
|
179
|
-
switch (typeName) {
|
|
180
|
-
case 'Schema':
|
|
181
|
-
return 'schemas';
|
|
182
|
-
case 'Parameter':
|
|
183
|
-
return 'parameters';
|
|
184
|
-
case 'Response':
|
|
185
|
-
return 'responses';
|
|
186
|
-
case 'Example':
|
|
187
|
-
return 'examples';
|
|
188
|
-
case 'RequestBody':
|
|
189
|
-
return 'requestBodies';
|
|
190
|
-
case 'Header':
|
|
191
|
-
return 'headers';
|
|
192
|
-
case 'SecuritySchema':
|
|
193
|
-
return 'securitySchemes';
|
|
194
|
-
case 'Link':
|
|
195
|
-
return 'links';
|
|
196
|
-
case 'Callback':
|
|
197
|
-
return 'callbacks';
|
|
198
|
-
default:
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
201
|
-
case OasMajorVersion.Version2:
|
|
202
|
-
switch (typeName) {
|
|
203
|
-
case 'Schema':
|
|
204
|
-
return 'definitions';
|
|
205
|
-
case 'Parameter':
|
|
206
|
-
return 'parameters';
|
|
207
|
-
case 'Response':
|
|
208
|
-
return 'responses';
|
|
209
|
-
default:
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// function oas3Move
|
|
216
|
-
|
|
217
|
-
function makeBundleVisitor(
|
|
218
|
-
version: OasMajorVersion,
|
|
219
|
-
dereference: boolean,
|
|
220
|
-
skipRedoclyRegistryRefs: boolean,
|
|
221
|
-
rootDocument: Document,
|
|
222
|
-
resolvedRefMap: ResolvedRefMap,
|
|
223
|
-
keepUrlRefs: boolean
|
|
224
|
-
) {
|
|
225
|
-
let components: Record<string, Record<string, any>>;
|
|
226
|
-
|
|
227
|
-
const visitor: Oas3Visitor | Oas2Visitor = {
|
|
228
|
-
ref: {
|
|
229
|
-
leave(node, ctx, resolved) {
|
|
230
|
-
if (!resolved.location || resolved.node === undefined) {
|
|
231
|
-
reportUnresolvedRef(resolved, ctx.report, ctx.location);
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
if (
|
|
235
|
-
resolved.location.source === rootDocument.source &&
|
|
236
|
-
resolved.location.source === ctx.location.source &&
|
|
237
|
-
ctx.type.name !== 'scalar' &&
|
|
238
|
-
!dereference
|
|
239
|
-
) {
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// do not bundle registry URL before push, otherwise we can't record dependencies
|
|
244
|
-
if (skipRedoclyRegistryRefs && isRedoclyRegistryURL(node.$ref)) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (keepUrlRefs && isAbsoluteUrl(node.$ref)) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
const componentType = mapTypeToComponent(ctx.type.name, version);
|
|
253
|
-
if (!componentType) {
|
|
254
|
-
replaceRef(node, resolved, ctx);
|
|
255
|
-
} else {
|
|
256
|
-
if (dereference) {
|
|
257
|
-
saveComponent(componentType, resolved, ctx);
|
|
258
|
-
replaceRef(node, resolved, ctx);
|
|
259
|
-
} else {
|
|
260
|
-
node.$ref = saveComponent(componentType, resolved, ctx);
|
|
261
|
-
resolveBundledComponent(node, resolved, ctx);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
Root: {
|
|
267
|
-
enter(root: any) {
|
|
268
|
-
if (version === OasMajorVersion.Version3) {
|
|
269
|
-
components = root.components = root.components || {};
|
|
270
|
-
} else if (version === OasMajorVersion.Version2) {
|
|
271
|
-
components = root;
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
if (version === OasMajorVersion.Version3) {
|
|
278
|
-
visitor.DiscriminatorMapping = {
|
|
279
|
-
leave(mapping: Record<string, string>, ctx: any) {
|
|
280
|
-
for (const name of Object.keys(mapping)) {
|
|
281
|
-
const $ref = mapping[name];
|
|
282
|
-
const resolved = ctx.resolve({ $ref });
|
|
283
|
-
if (!resolved.location || resolved.node === undefined) {
|
|
284
|
-
reportUnresolvedRef(resolved, ctx.report, ctx.location.child(name));
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const componentType = mapTypeToComponent('Schema', version)!;
|
|
289
|
-
if (dereference) {
|
|
290
|
-
saveComponent(componentType, resolved, ctx);
|
|
291
|
-
} else {
|
|
292
|
-
mapping[name] = saveComponent(componentType, resolved, ctx);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function resolveBundledComponent(node: OasRef, resolved: ResolveResult<any>, ctx: UserContext) {
|
|
300
|
-
const newRefId = makeRefId(ctx.location.source.absoluteRef, node.$ref);
|
|
301
|
-
resolvedRefMap.set(newRefId, {
|
|
302
|
-
document: rootDocument,
|
|
303
|
-
isRemote: false,
|
|
304
|
-
node: resolved.node,
|
|
305
|
-
nodePointer: node.$ref,
|
|
306
|
-
resolved: true,
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function replaceRef(ref: OasRef, resolved: ResolveResult<any>, ctx: UserContext) {
|
|
311
|
-
if (!isPlainObject(resolved.node)) {
|
|
312
|
-
ctx.parent[ctx.key] = resolved.node;
|
|
313
|
-
} else {
|
|
314
|
-
// TODO: why $ref isn't optional in OasRef?
|
|
315
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
316
|
-
// @ts-ignore
|
|
317
|
-
delete ref.$ref;
|
|
318
|
-
const obj = Object.assign({}, resolved.node, ref);
|
|
319
|
-
Object.assign(ref, obj); // assign ref itself again so ref fields take precedence
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
function saveComponent(
|
|
324
|
-
componentType: string,
|
|
325
|
-
target: { node: any; location: Location },
|
|
326
|
-
ctx: UserContext
|
|
327
|
-
) {
|
|
328
|
-
components[componentType] = components[componentType] || {};
|
|
329
|
-
const name = getComponentName(target, componentType, ctx);
|
|
330
|
-
components[componentType][name] = target.node;
|
|
331
|
-
if (version === OasMajorVersion.Version3) {
|
|
332
|
-
return `#/components/${componentType}/${name}`;
|
|
333
|
-
} else {
|
|
334
|
-
return `#/${componentType}/${name}`;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function isEqualOrEqualRef(
|
|
339
|
-
node: any,
|
|
340
|
-
target: { node: any; location: Location },
|
|
341
|
-
ctx: UserContext
|
|
342
|
-
) {
|
|
343
|
-
if (
|
|
344
|
-
isRef(node) &&
|
|
345
|
-
ctx.resolve(node).location?.absolutePointer === target.location.absolutePointer
|
|
346
|
-
) {
|
|
347
|
-
return true;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
return isEqual(node, target.node);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
function getComponentName(
|
|
354
|
-
target: { node: any; location: Location },
|
|
355
|
-
componentType: string,
|
|
356
|
-
ctx: UserContext
|
|
357
|
-
) {
|
|
358
|
-
const [fileRef, pointer] = [target.location.source.absoluteRef, target.location.pointer];
|
|
359
|
-
const componentsGroup = components[componentType];
|
|
360
|
-
|
|
361
|
-
let name = '';
|
|
362
|
-
|
|
363
|
-
const refParts = pointer.slice(2).split('/').filter(isTruthy); // slice(2) removes "#/"
|
|
364
|
-
while (refParts.length > 0) {
|
|
365
|
-
name = refParts.pop() + (name ? `-${name}` : '');
|
|
366
|
-
if (
|
|
367
|
-
!componentsGroup ||
|
|
368
|
-
!componentsGroup[name] ||
|
|
369
|
-
isEqualOrEqualRef(componentsGroup[name], target, ctx)
|
|
370
|
-
) {
|
|
371
|
-
return name;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
name = refBaseName(fileRef) + (name ? `_${name}` : '');
|
|
376
|
-
if (!componentsGroup[name] || isEqualOrEqualRef(componentsGroup[name], target, ctx)) {
|
|
377
|
-
return name;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
const prevName = name;
|
|
381
|
-
let serialId = 2;
|
|
382
|
-
while (componentsGroup[name] && !isEqualOrEqualRef(componentsGroup[name], target, ctx)) {
|
|
383
|
-
name = `${prevName}-${serialId}`;
|
|
384
|
-
serialId++;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
if (!componentsGroup[name]) {
|
|
388
|
-
ctx.report({
|
|
389
|
-
message: `Two schemas are referenced with the same name but different content. Renamed ${prevName} to ${name}.`,
|
|
390
|
-
location: ctx.location,
|
|
391
|
-
forceSeverity: 'warn',
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
return name;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
return visitor;
|
|
399
|
-
}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`resolveConfig should ignore minimal from the root and read local file 1`] = `
|
|
4
|
-
Object {
|
|
5
|
-
"decorators": Object {},
|
|
6
|
-
"doNotResolveExamples": undefined,
|
|
7
|
-
"oas2Decorators": Object {},
|
|
8
|
-
"oas2Preprocessors": Object {},
|
|
9
|
-
"oas2Rules": Object {},
|
|
10
|
-
"oas3_0Decorators": Object {},
|
|
11
|
-
"oas3_0Preprocessors": Object {},
|
|
12
|
-
"oas3_0Rules": Object {
|
|
13
|
-
"no-empty-servers": "error",
|
|
14
|
-
"no-example-value-and-externalValue": "error",
|
|
15
|
-
"no-invalid-media-type-examples": "error",
|
|
16
|
-
"no-server-example.com": "warn",
|
|
17
|
-
"no-server-trailing-slash": "error",
|
|
18
|
-
"no-server-variables-empty-enum": "error",
|
|
19
|
-
"no-undefined-server-variable": "error",
|
|
20
|
-
"no-unused-components": "warn",
|
|
21
|
-
"spec-components-invalid-map-name": "error",
|
|
22
|
-
},
|
|
23
|
-
"oas3_1Decorators": Object {},
|
|
24
|
-
"oas3_1Preprocessors": Object {},
|
|
25
|
-
"oas3_1Rules": Object {
|
|
26
|
-
"no-empty-servers": "error",
|
|
27
|
-
"no-example-value-and-externalValue": "error",
|
|
28
|
-
"no-invalid-media-type-examples": "error",
|
|
29
|
-
"no-server-example.com": "warn",
|
|
30
|
-
"no-server-trailing-slash": "error",
|
|
31
|
-
"no-server-variables-empty-enum": "error",
|
|
32
|
-
"no-undefined-server-variable": "error",
|
|
33
|
-
"no-unused-components": "warn",
|
|
34
|
-
"spec-components-invalid-map-name": "error",
|
|
35
|
-
},
|
|
36
|
-
"preprocessors": Object {},
|
|
37
|
-
"recommendedFallback": false,
|
|
38
|
-
"rules": Object {
|
|
39
|
-
"assertions": "warn",
|
|
40
|
-
"boolean-parameter-prefixes": "error",
|
|
41
|
-
"info-contact": "off",
|
|
42
|
-
"info-license": "warn",
|
|
43
|
-
"info-license-url": "warn",
|
|
44
|
-
"local/operation-id-not-test": "error",
|
|
45
|
-
"no-ambiguous-paths": "warn",
|
|
46
|
-
"no-enum-type-mismatch": "error",
|
|
47
|
-
"no-identical-paths": "error",
|
|
48
|
-
"no-invalid-media-type-examples": "error",
|
|
49
|
-
"no-path-trailing-slash": "error",
|
|
50
|
-
"no-unresolved-refs": "error",
|
|
51
|
-
"operation-2xx-response": "warn",
|
|
52
|
-
"operation-4xx-response": "error",
|
|
53
|
-
"operation-description": "error",
|
|
54
|
-
"operation-operationId": "warn",
|
|
55
|
-
"operation-operationId-unique": "error",
|
|
56
|
-
"operation-operationId-url-safe": "error",
|
|
57
|
-
"operation-parameters-unique": "error",
|
|
58
|
-
"operation-singular-tag": "off",
|
|
59
|
-
"operation-summary": "error",
|
|
60
|
-
"operation-tag-defined": "off",
|
|
61
|
-
"parameter-description": "off",
|
|
62
|
-
"path-declaration-must-exist": "error",
|
|
63
|
-
"path-http-verbs-order": "error",
|
|
64
|
-
"path-not-include-query": "error",
|
|
65
|
-
"path-parameters-defined": "error",
|
|
66
|
-
"paths-kebab-case": "off",
|
|
67
|
-
"security-defined": "error",
|
|
68
|
-
"spec": "error",
|
|
69
|
-
"tag-description": "warn",
|
|
70
|
-
"tags-alphabetical": "off",
|
|
71
|
-
},
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
|
-
exports[`resolveStyleguideConfig should resolve extends with local file config which contains path to nested config 1`] = `
|
|
76
|
-
Object {
|
|
77
|
-
"decorators": Object {},
|
|
78
|
-
"doNotResolveExamples": undefined,
|
|
79
|
-
"oas2Decorators": Object {},
|
|
80
|
-
"oas2Preprocessors": Object {},
|
|
81
|
-
"oas2Rules": Object {},
|
|
82
|
-
"oas3_0Decorators": Object {},
|
|
83
|
-
"oas3_0Preprocessors": Object {},
|
|
84
|
-
"oas3_0Rules": Object {
|
|
85
|
-
"no-empty-servers": "error",
|
|
86
|
-
"no-example-value-and-externalValue": "error",
|
|
87
|
-
"no-invalid-media-type-examples": "warn",
|
|
88
|
-
"no-server-example.com": "warn",
|
|
89
|
-
"no-server-trailing-slash": "error",
|
|
90
|
-
"no-server-variables-empty-enum": "error",
|
|
91
|
-
"no-undefined-server-variable": "error",
|
|
92
|
-
"no-unused-components": "warn",
|
|
93
|
-
"spec-components-invalid-map-name": "error",
|
|
94
|
-
},
|
|
95
|
-
"oas3_1Decorators": Object {},
|
|
96
|
-
"oas3_1Preprocessors": Object {},
|
|
97
|
-
"oas3_1Rules": Object {
|
|
98
|
-
"no-empty-servers": "error",
|
|
99
|
-
"no-example-value-and-externalValue": "error",
|
|
100
|
-
"no-invalid-media-type-examples": "warn",
|
|
101
|
-
"no-server-example.com": "warn",
|
|
102
|
-
"no-server-trailing-slash": "error",
|
|
103
|
-
"no-server-variables-empty-enum": "error",
|
|
104
|
-
"no-undefined-server-variable": "error",
|
|
105
|
-
"no-unused-components": "warn",
|
|
106
|
-
"spec-components-invalid-map-name": "error",
|
|
107
|
-
},
|
|
108
|
-
"preprocessors": Object {},
|
|
109
|
-
"recommendedFallback": undefined,
|
|
110
|
-
"rules": Object {
|
|
111
|
-
"assertions": Array [
|
|
112
|
-
Object {
|
|
113
|
-
"assertionId": "path-item-get-defined",
|
|
114
|
-
"defined": true,
|
|
115
|
-
"message": "Every path item must have a GET operation.",
|
|
116
|
-
"property": "get",
|
|
117
|
-
"subject": "PathItem",
|
|
118
|
-
},
|
|
119
|
-
Object {
|
|
120
|
-
"assertionId": "tag-description",
|
|
121
|
-
"message": "Tag description must be at least 13 characters and end with a full stop.",
|
|
122
|
-
"minLength": 13,
|
|
123
|
-
"pattern": "/\\\\.$/",
|
|
124
|
-
"property": "description",
|
|
125
|
-
"severity": "error",
|
|
126
|
-
"subject": "Tag",
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
"boolean-parameter-prefixes": "error",
|
|
130
|
-
"info-contact": "off",
|
|
131
|
-
"info-license": "warn",
|
|
132
|
-
"info-license-url": "warn",
|
|
133
|
-
"local/operation-id-not-test": "error",
|
|
134
|
-
"no-ambiguous-paths": "warn",
|
|
135
|
-
"no-enum-type-mismatch": "error",
|
|
136
|
-
"no-identical-paths": "error",
|
|
137
|
-
"no-invalid-media-type-examples": "warn",
|
|
138
|
-
"no-path-trailing-slash": "error",
|
|
139
|
-
"no-unresolved-refs": "error",
|
|
140
|
-
"operation-2xx-response": "error",
|
|
141
|
-
"operation-4xx-response": "off",
|
|
142
|
-
"operation-description": "off",
|
|
143
|
-
"operation-operationId": "warn",
|
|
144
|
-
"operation-operationId-unique": "error",
|
|
145
|
-
"operation-operationId-url-safe": "error",
|
|
146
|
-
"operation-parameters-unique": "error",
|
|
147
|
-
"operation-singular-tag": "off",
|
|
148
|
-
"operation-summary": "error",
|
|
149
|
-
"operation-tag-defined": "off",
|
|
150
|
-
"parameter-description": "off",
|
|
151
|
-
"path-declaration-must-exist": "error",
|
|
152
|
-
"path-not-include-query": "error",
|
|
153
|
-
"path-parameters-defined": "error",
|
|
154
|
-
"paths-kebab-case": "off",
|
|
155
|
-
"security-defined": "error",
|
|
156
|
-
"spec": "error",
|
|
157
|
-
"tag-description": "warn",
|
|
158
|
-
"tags-alphabetical": "off",
|
|
159
|
-
},
|
|
160
|
-
}
|
|
161
|
-
`;
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`generation ignore object should generate config with absoluteUri for ignore 1`] = `
|
|
4
|
-
StyleguideConfig {
|
|
5
|
-
"_usedRules": Set {},
|
|
6
|
-
"_usedVersions": Set {},
|
|
7
|
-
"configFile": undefined,
|
|
8
|
-
"decorators": Object {
|
|
9
|
-
"oas2": Object {
|
|
10
|
-
"oas2": Object {},
|
|
11
|
-
"oas3_0": Object {},
|
|
12
|
-
"oas3_1": Object {},
|
|
13
|
-
},
|
|
14
|
-
"oas3_0": Object {
|
|
15
|
-
"oas2": Object {},
|
|
16
|
-
"oas3_0": Object {},
|
|
17
|
-
"oas3_1": Object {},
|
|
18
|
-
},
|
|
19
|
-
"oas3_1": Object {
|
|
20
|
-
"oas2": Object {},
|
|
21
|
-
"oas3_0": Object {},
|
|
22
|
-
"oas3_1": Object {},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
"doNotResolveExamples": false,
|
|
26
|
-
"extendPaths": Array [],
|
|
27
|
-
"ignore": Object {
|
|
28
|
-
"https://some-path.yaml": Object {
|
|
29
|
-
"no-unused-components": Set {
|
|
30
|
-
"#/components/schemas/Foo",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
"some-path/openapi.yaml": Object {
|
|
34
|
-
"no-unused-components": Set {
|
|
35
|
-
"#/components/schemas/Foo",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
"pluginPaths": Array [],
|
|
40
|
-
"plugins": Array [],
|
|
41
|
-
"preprocessors": Object {
|
|
42
|
-
"oas2": Object {
|
|
43
|
-
"oas2": Object {},
|
|
44
|
-
"oas3_0": Object {},
|
|
45
|
-
"oas3_1": Object {},
|
|
46
|
-
},
|
|
47
|
-
"oas3_0": Object {
|
|
48
|
-
"oas2": Object {},
|
|
49
|
-
"oas3_0": Object {},
|
|
50
|
-
"oas3_1": Object {},
|
|
51
|
-
},
|
|
52
|
-
"oas3_1": Object {
|
|
53
|
-
"oas2": Object {},
|
|
54
|
-
"oas3_0": Object {},
|
|
55
|
-
"oas3_1": Object {},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
"rawConfig": Object {
|
|
59
|
-
"_usedRules": Set {},
|
|
60
|
-
"_usedVersions": Set {},
|
|
61
|
-
"configFile": "redocly.yaml",
|
|
62
|
-
"decorators": Object {
|
|
63
|
-
"oas2": Object {},
|
|
64
|
-
"oas3_0": Object {},
|
|
65
|
-
"oas3_1": Object {},
|
|
66
|
-
},
|
|
67
|
-
"doNotResolveExamples": false,
|
|
68
|
-
"ignore": Object {},
|
|
69
|
-
"plugins": Array [],
|
|
70
|
-
"preprocessors": Object {
|
|
71
|
-
"oas2": Object {},
|
|
72
|
-
"oas3_0": Object {},
|
|
73
|
-
"oas3_1": Object {},
|
|
74
|
-
},
|
|
75
|
-
"rawConfig": Object {
|
|
76
|
-
"plugins": Array [],
|
|
77
|
-
"rules": Object {
|
|
78
|
-
"no-empty-servers": "error",
|
|
79
|
-
"operation-summary": "error",
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
"recommendedFallback": false,
|
|
83
|
-
"rules": Object {
|
|
84
|
-
"oas2": Object {
|
|
85
|
-
"no-empty-servers": "error",
|
|
86
|
-
"operation-summary": "error",
|
|
87
|
-
},
|
|
88
|
-
"oas3_0": Object {
|
|
89
|
-
"no-empty-servers": "error",
|
|
90
|
-
"operation-summary": "error",
|
|
91
|
-
},
|
|
92
|
-
"oas3_1": Object {
|
|
93
|
-
"no-empty-servers": "error",
|
|
94
|
-
"operation-summary": "error",
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
"recommendedFallback": false,
|
|
99
|
-
"rules": Object {
|
|
100
|
-
"oas2": Object {
|
|
101
|
-
"oas2": Object {
|
|
102
|
-
"no-empty-servers": "error",
|
|
103
|
-
"operation-summary": "error",
|
|
104
|
-
},
|
|
105
|
-
"oas3_0": Object {
|
|
106
|
-
"no-empty-servers": "error",
|
|
107
|
-
"operation-summary": "error",
|
|
108
|
-
},
|
|
109
|
-
"oas3_1": Object {
|
|
110
|
-
"no-empty-servers": "error",
|
|
111
|
-
"operation-summary": "error",
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
"oas3_0": Object {
|
|
115
|
-
"oas2": Object {
|
|
116
|
-
"no-empty-servers": "error",
|
|
117
|
-
"operation-summary": "error",
|
|
118
|
-
},
|
|
119
|
-
"oas3_0": Object {
|
|
120
|
-
"no-empty-servers": "error",
|
|
121
|
-
"operation-summary": "error",
|
|
122
|
-
},
|
|
123
|
-
"oas3_1": Object {
|
|
124
|
-
"no-empty-servers": "error",
|
|
125
|
-
"operation-summary": "error",
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
"oas3_1": Object {
|
|
129
|
-
"oas2": Object {
|
|
130
|
-
"no-empty-servers": "error",
|
|
131
|
-
"operation-summary": "error",
|
|
132
|
-
},
|
|
133
|
-
"oas3_0": Object {
|
|
134
|
-
"no-empty-servers": "error",
|
|
135
|
-
"operation-summary": "error",
|
|
136
|
-
},
|
|
137
|
-
"oas3_1": Object {
|
|
138
|
-
"no-empty-servers": "error",
|
|
139
|
-
"operation-summary": "error",
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
}
|
|
144
|
-
`;
|