@redocly/openapi-core 1.19.0 → 1.20.1
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/CHANGELOG.md +14 -0
- package/__tests__/utils.ts +14 -7
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +1 -0
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +5 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +1 -0
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +5 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +1 -0
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +5 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +1 -0
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +17 -13
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +1 -0
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +16 -12
- package/lib/benchmark/utils.d.ts +3 -3
- package/lib/benchmark/utils.js +3 -3
- package/lib/config/all.js +4 -1
- package/lib/config/builtIn.js +15 -20
- package/lib/config/config-resolvers.d.ts +1 -1
- package/lib/config/config-resolvers.js +67 -28
- package/lib/config/config.d.ts +3 -2
- package/lib/config/load.d.ts +1 -1
- package/lib/config/minimal.js +4 -0
- package/lib/config/recommended-strict.js +5 -1
- package/lib/config/recommended.js +5 -1
- package/lib/config/types.d.ts +9 -2
- package/lib/config/utils.d.ts +3 -1
- package/lib/config/utils.js +8 -0
- package/lib/decorators/common/filters/filter-helper.d.ts +1 -1
- package/lib/decorators/common/filters/filter-in.d.ts +1 -1
- package/lib/decorators/common/filters/filter-out.d.ts +1 -1
- package/lib/decorators/common/info-description-override.d.ts +1 -1
- package/lib/decorators/common/info-override.d.ts +1 -1
- package/lib/decorators/common/media-type-examples-override.d.ts +1 -1
- package/lib/decorators/common/operation-description-override.d.ts +1 -1
- package/lib/decorators/common/registry-dependencies.d.ts +1 -1
- package/lib/decorators/common/remove-x-internal.d.ts +1 -1
- package/lib/decorators/common/tag-description-override.d.ts +1 -1
- package/lib/decorators/oas2/index.d.ts +1 -1
- package/lib/decorators/oas3/index.d.ts +1 -1
- package/lib/format/codeframes.d.ts +1 -1
- package/lib/format/format.d.ts +1 -1
- package/lib/format/format.js +1 -1
- package/lib/js-yaml/index.d.ts +1 -1
- package/lib/lint.d.ts +1 -1
- package/lib/logger.js +2 -2
- package/lib/oas-types.d.ts +2 -2
- package/lib/redocly/domains.d.ts +1 -1
- package/lib/redocly/index.d.ts +1 -1
- package/lib/ref-utils.d.ts +2 -2
- package/lib/ref-utils.js +1 -0
- package/lib/resolve.d.ts +2 -2
- package/lib/rules/ajv.d.ts +1 -1
- package/lib/rules/arazzo/index.js +2 -0
- package/lib/rules/async2/channels-kebab-case.d.ts +1 -1
- package/lib/rules/async2/index.js +2 -0
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +1 -1
- package/lib/rules/async3/channels-kebab-case.d.ts +1 -1
- package/lib/rules/async3/index.js +2 -0
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +1 -1
- package/lib/rules/common/assertions/asserts.d.ts +2 -2
- package/lib/rules/common/assertions/index.d.ts +1 -2
- package/lib/rules/common/assertions/utils.d.ts +1 -1
- package/lib/rules/common/info-contact.d.ts +1 -1
- package/lib/rules/common/info-license-strict.d.ts +2 -0
- package/lib/rules/common/info-license-strict.js +26 -0
- package/lib/rules/common/info-license-url.d.ts +1 -1
- package/lib/rules/common/info-license.d.ts +1 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts +1 -1
- package/lib/rules/common/no-enum-type-mismatch.d.ts +1 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +1 -1
- package/lib/rules/common/no-identical-paths.d.ts +1 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts +1 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +1 -1
- package/lib/rules/common/operation-2xx-response.d.ts +1 -1
- package/lib/rules/common/operation-4xx-response.d.ts +1 -1
- package/lib/rules/common/operation-description.d.ts +1 -1
- package/lib/rules/common/operation-operationId-unique.d.ts +1 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts +1 -1
- package/lib/rules/common/operation-operationId-url-safe.js +1 -0
- package/lib/rules/common/operation-operationId.d.ts +1 -1
- package/lib/rules/common/operation-parameters-unique.d.ts +1 -1
- package/lib/rules/common/operation-singular-tag.d.ts +1 -1
- package/lib/rules/common/operation-summary.d.ts +1 -1
- package/lib/rules/common/operation-tag-defined.d.ts +1 -1
- package/lib/rules/common/parameter-description.d.ts +1 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts +1 -1
- package/lib/rules/common/path-excludes-patterns.d.ts +1 -1
- package/lib/rules/common/path-http-verbs-order.d.ts +1 -1
- package/lib/rules/common/path-not-include-query.d.ts +1 -1
- package/lib/rules/common/path-params-defined.d.ts +1 -1
- package/lib/rules/common/path-segment-plural.d.ts +1 -1
- package/lib/rules/common/paths-kebab-case.d.ts +1 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +1 -1
- package/lib/rules/common/response-contains-header.d.ts +1 -1
- package/lib/rules/common/security-defined.d.ts +1 -1
- package/lib/rules/common/spec-strict-refs.d.ts +1 -1
- package/lib/rules/common/tag-description.d.ts +1 -1
- package/lib/rules/common/tags-alphabetical.d.ts +1 -1
- package/lib/rules/no-unresolved-refs.d.ts +3 -3
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -1
- package/lib/rules/oas2/index.d.ts +1 -1
- package/lib/rules/oas2/index.js +2 -0
- package/lib/rules/oas2/response-contains-property.d.ts +1 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts +1 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -1
- package/lib/rules/oas3/component-name-unique.d.ts +1 -1
- package/lib/rules/oas3/index.d.ts +1 -1
- package/lib/rules/oas3/index.js +2 -0
- package/lib/rules/oas3/no-empty-servers.d.ts +1 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +1 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +1 -1
- package/lib/rules/oas3/no-server-example.com.d.ts +1 -1
- package/lib/rules/oas3/no-server-example.com.js +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +1 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +1 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +1 -1
- package/lib/rules/oas3/no-unused-components.d.ts +1 -1
- package/lib/rules/oas3/response-contains-property.d.ts +1 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +1 -1
- package/lib/rules/other/stats.d.ts +3 -3
- package/lib/rules/other/stats.js +5 -3
- package/lib/rules/spot/parameters-no-body-inside-in.d.ts +2 -0
- package/lib/rules/spot/parameters-no-body-inside-in.js +18 -0
- package/lib/rules/utils.d.ts +4 -2
- package/lib/rules/utils.js +27 -1
- package/lib/types/arazzo.d.ts +1 -2275
- package/lib/types/arazzo.js +246 -309
- package/lib/types/asyncapi2.d.ts +1 -1
- package/lib/types/asyncapi2.js +3 -1
- package/lib/types/asyncapi3.d.ts +1 -1
- package/lib/types/json-schema-adapter.d.ts +1 -1
- package/lib/types/oas3.d.ts +4 -0
- package/lib/types/oas3.js +9 -9
- package/lib/types/oas3_1.d.ts +3 -0
- package/lib/types/oas3_1.js +8 -8
- package/lib/types/redocly-yaml.d.ts +6 -6
- package/lib/types/redocly-yaml.js +4 -1
- package/lib/typings/arazzo.d.ts +145 -27
- package/lib/typings/common.d.ts +1 -1
- package/lib/typings/swagger.d.ts +2 -2
- package/lib/visitors.d.ts +18 -1
- package/lib/walk.d.ts +3 -3
- package/package.json +2 -2
- package/src/__tests__/bundle.test.ts +4 -4
- package/src/__tests__/lint.test.ts +29 -21
- package/src/__tests__/walk.test.ts +25 -25
- package/src/benchmark/benches/lint-with-many-rules.bench.ts +7 -1
- package/src/benchmark/benches/lint-with-nested-rule.bench.ts +7 -1
- package/src/benchmark/benches/lint-with-no-rules.bench.ts +8 -1
- package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +18 -13
- package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +17 -11
- package/src/benchmark/fork.js +4 -0
- package/src/benchmark/utils.ts +6 -5
- package/src/bundle.ts +2 -1
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +10 -2
- package/src/config/__tests__/config-resolvers.test.ts +82 -0
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-commonjs-export-function.yaml +2 -0
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-esm.yaml +2 -0
- package/src/config/__tests__/fixtures/resolve-config/plugin-esm.mjs +10 -0
- package/src/config/__tests__/fixtures/resolve-config/plugin-with-export-function.cjs +10 -0
- package/src/config/__tests__/resolve-plugins.test.ts +4 -1
- package/src/config/all.ts +4 -1
- package/src/config/builtIn.ts +5 -10
- package/src/config/config-resolvers.ts +78 -23
- package/src/config/config.ts +7 -8
- package/src/config/load.ts +2 -2
- package/src/config/minimal.ts +4 -0
- package/src/config/recommended-strict.ts +5 -1
- package/src/config/recommended.ts +5 -1
- package/src/config/types.ts +19 -3
- package/src/config/utils.ts +13 -2
- package/src/decorators/__tests__/filter-in.test.ts +29 -26
- package/src/decorators/__tests__/filter-out.test.ts +32 -23
- package/src/decorators/__tests__/media-type-examples-override.test.ts +45 -45
- package/src/decorators/__tests__/remove-x-internal.test.ts +8 -5
- package/src/decorators/common/filters/filter-helper.ts +2 -1
- package/src/decorators/common/filters/filter-in.ts +2 -1
- package/src/decorators/common/filters/filter-out.ts +2 -1
- package/src/decorators/common/info-description-override.ts +3 -2
- package/src/decorators/common/info-override.ts +1 -1
- package/src/decorators/common/media-type-examples-override.ts +4 -3
- package/src/decorators/common/operation-description-override.ts +5 -4
- package/src/decorators/common/registry-dependencies.ts +2 -2
- package/src/decorators/common/remove-x-internal.ts +3 -2
- package/src/decorators/common/tag-description-override.ts +3 -2
- package/src/decorators/oas2/__tests__/remove-unused-components.test.ts +3 -3
- package/src/decorators/oas2/index.ts +2 -1
- package/src/decorators/oas2/remove-unused-components.ts +1 -1
- package/src/decorators/oas3/__tests__/remove-unused-components.test.ts +4 -4
- package/src/decorators/oas3/index.ts +2 -1
- package/src/decorators/oas3/remove-unused-components.ts +1 -1
- package/src/format/codeframes.ts +2 -1
- package/src/format/format.ts +9 -4
- package/src/js-yaml/index.ts +3 -1
- package/src/lint.ts +2 -1
- package/src/logger.ts +2 -2
- package/src/oas-types.ts +14 -13
- package/src/redocly/domains.ts +1 -1
- package/src/redocly/index.ts +3 -3
- package/src/redocly/registry-api.ts +5 -3
- package/src/ref-utils.ts +4 -2
- package/src/resolve.ts +6 -4
- package/src/rules/__tests__/no-unresolved-refs.test.ts +21 -7
- package/src/rules/ajv.ts +2 -1
- package/src/rules/arazzo/__tests__/parameters-no-body-inside-in.test.ts +76 -0
- package/src/rules/arazzo/index.ts +5 -2
- package/src/rules/async2/__tests__/channels-kebab-case.test.ts +9 -5
- package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +3 -3
- package/src/rules/async2/channels-kebab-case.ts +2 -2
- package/src/rules/async2/index.ts +4 -1
- package/src/rules/async2/no-channel-trailing-slash.ts +2 -2
- package/src/rules/async3/__tests__/channels-kebab-case.test.ts +9 -5
- package/src/rules/async3/__tests__/no-channel-trailing-slash.test.ts +3 -3
- package/src/rules/async3/channels-kebab-case.ts +3 -3
- package/src/rules/async3/index.ts +4 -1
- package/src/rules/async3/no-channel-trailing-slash.ts +3 -3
- package/src/rules/common/__tests__/info-license-strict.test.ts +141 -0
- package/src/rules/common/__tests__/info-license.test.ts +2 -2
- package/src/rules/common/__tests__/license-url.test.ts +2 -2
- package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +1 -1
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +5 -5
- package/src/rules/common/__tests__/no-identical-paths.test.ts +1 -1
- package/src/rules/common/__tests__/no-invalid-parameter-examples.test.ts +1 -1
- package/src/rules/common/__tests__/no-invalid-schema-examples.test.ts +1 -1
- package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +4 -4
- package/src/rules/common/__tests__/no-required-schema-properties-undefined.test.ts +11 -11
- package/src/rules/common/__tests__/operation-2xx-response.test.ts +8 -6
- package/src/rules/common/__tests__/operation-4xx-response.test.ts +9 -7
- package/src/rules/common/__tests__/operation-operationId-unique.test.ts +2 -2
- package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +1 -1
- package/src/rules/common/__tests__/operation-parameters-unique.test.ts +4 -4
- package/src/rules/common/__tests__/operation-singular-tag.test.ts +2 -2
- package/src/rules/common/__tests__/path-http-verbs-order.test.ts +2 -2
- package/src/rules/common/__tests__/path-not-include-query.test.ts +2 -2
- package/src/rules/common/__tests__/path-params-defined.test.ts +5 -5
- package/src/rules/common/__tests__/paths-kebab-case.test.ts +6 -4
- package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +8 -8
- package/src/rules/common/__tests__/security-defined.test.ts +14 -8
- package/src/rules/common/__tests__/spec-strict-refs.test.ts +1 -1
- package/src/rules/common/__tests__/spec.test.ts +10 -10
- package/src/rules/common/__tests__/tag-description.test.ts +2 -2
- package/src/rules/common/__tests__/tags-alphabetical.test.ts +6 -4
- package/src/rules/common/assertions/asserts.ts +5 -9
- package/src/rules/common/assertions/index.ts +1 -2
- package/src/rules/common/assertions/utils.ts +4 -2
- package/src/rules/common/info-contact.ts +2 -1
- package/src/rules/common/info-license-strict.ts +24 -0
- package/src/rules/common/info-license-url.ts +2 -1
- package/src/rules/common/info-license.ts +2 -1
- package/src/rules/common/no-ambiguous-paths.ts +4 -4
- package/src/rules/common/no-enum-type-mismatch.ts +5 -4
- package/src/rules/common/no-http-verbs-in-paths.ts +5 -4
- package/src/rules/common/no-identical-paths.ts +4 -4
- package/src/rules/common/no-invalid-parameter-examples.ts +3 -2
- package/src/rules/common/no-path-trailing-slash.ts +2 -2
- package/src/rules/common/no-required-schema-properties-undefined.ts +5 -4
- package/src/rules/common/operation-2xx-response.ts +3 -2
- package/src/rules/common/operation-4xx-response.ts +3 -2
- package/src/rules/common/operation-description.ts +5 -4
- package/src/rules/common/operation-operationId-unique.ts +4 -4
- package/src/rules/common/operation-operationId-url-safe.ts +5 -4
- package/src/rules/common/operation-operationId.ts +5 -4
- package/src/rules/common/operation-parameters-unique.ts +4 -4
- package/src/rules/common/operation-singular-tag.ts +4 -4
- package/src/rules/common/operation-summary.ts +5 -4
- package/src/rules/common/operation-tag-defined.ts +4 -4
- package/src/rules/common/parameter-description.ts +4 -4
- package/src/rules/common/path-declaration-must-exist.ts +2 -2
- package/src/rules/common/path-excludes-patterns.ts +4 -4
- package/src/rules/common/path-http-verbs-order.ts +4 -4
- package/src/rules/common/path-not-include-query.ts +2 -2
- package/src/rules/common/path-params-defined.ts +4 -4
- package/src/rules/common/path-segment-plural.ts +3 -2
- package/src/rules/common/paths-kebab-case.ts +2 -2
- package/src/rules/common/required-string-property-missing-min-length.ts +4 -4
- package/src/rules/common/response-contains-header.ts +5 -4
- package/src/rules/common/scalar-property-missing-example.ts +2 -1
- package/src/rules/common/security-defined.ts +5 -5
- package/src/rules/common/spec-strict-refs.ts +2 -1
- package/src/rules/common/spec.ts +3 -2
- package/src/rules/common/tag-description.ts +2 -1
- package/src/rules/common/tags-alphabetical.ts +4 -4
- package/src/rules/no-unresolved-refs.ts +4 -3
- package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +7 -5
- package/src/rules/oas2/__tests__/response-contains-header.test.ts +14 -8
- package/src/rules/oas2/__tests__/response-contains-property.test.ts +14 -8
- package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +3 -1
- package/src/rules/oas2/boolean-parameter-prefixes.ts +1 -1
- package/src/rules/oas2/index.ts +4 -2
- package/src/rules/oas2/request-mime-type.ts +2 -1
- package/src/rules/oas2/response-contains-property.ts +3 -2
- package/src/rules/oas2/response-mime-type.ts +2 -1
- package/src/rules/oas3/__tests__/array-parameter-serialization.test.ts +18 -6
- package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +7 -5
- package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +6 -6
- package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +2 -2
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +34 -24
- package/src/rules/oas3/__tests__/no-server-example.com.test.ts +3 -3
- package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +3 -3
- package/src/rules/oas3/__tests__/no-unused-components.test.ts +1 -1
- package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +3 -3
- package/src/rules/oas3/__tests__/response-contains-header.test.ts +34 -22
- package/src/rules/oas3/__tests__/response-contains-property.test.ts +34 -20
- package/src/rules/oas3/__tests__/spec/spec.test.ts +12 -3
- package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +9 -3
- package/src/rules/oas3/__tests__/utils/lint-document-for-test.ts +1 -1
- package/src/rules/oas3/array-parameter-serialization.ts +3 -2
- package/src/rules/oas3/boolean-parameter-prefixes.ts +1 -1
- package/src/rules/oas3/component-name-unique.ts +3 -3
- package/src/rules/oas3/index.ts +3 -1
- package/src/rules/oas3/no-empty-servers.ts +1 -1
- package/src/rules/oas3/no-example-value-and-externalValue.ts +1 -1
- package/src/rules/oas3/no-invalid-media-type-examples.ts +6 -4
- package/src/rules/oas3/no-server-example.com.ts +2 -1
- package/src/rules/oas3/no-server-trailing-slash.ts +1 -1
- package/src/rules/oas3/no-server-variables-empty-enum.ts +2 -2
- package/src/rules/oas3/no-undefined-server-variable.ts +1 -1
- package/src/rules/oas3/no-unused-components.ts +2 -2
- package/src/rules/oas3/operation-4xx-problem-details-rfc7807.ts +2 -1
- package/src/rules/oas3/request-mime-type.ts +2 -1
- package/src/rules/oas3/response-contains-property.ts +3 -2
- package/src/rules/oas3/response-mime-type.ts +2 -1
- package/src/rules/oas3/spec-components-invalid-map-name.ts +3 -3
- package/src/rules/other/stats.ts +8 -6
- package/src/rules/spot/parameters-no-body-inside-in.ts +17 -0
- package/src/rules/utils.ts +41 -4
- package/src/types/arazzo.ts +257 -334
- package/src/types/asyncapi2.ts +4 -1
- package/src/types/asyncapi3.ts +3 -1
- package/src/types/json-schema-adapter.ts +2 -2
- package/src/types/oas3.ts +4 -4
- package/src/types/oas3_1.ts +3 -3
- package/src/types/redocly-yaml.ts +7 -4
- package/src/typings/arazzo.ts +169 -41
- package/src/typings/common.ts +1 -0
- package/src/typings/swagger.ts +2 -2
- package/src/visitors.ts +40 -1
- package/src/walk.ts +3 -3
- package/tsconfig.tsbuildinfo +1 -1
package/lib/types/oas3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Oas3Types = void 0;
|
|
3
|
+
exports.Oas3Types = exports.Discriminator = exports.DiscriminatorMapping = exports.Xml = exports.ExternalDocs = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
const ref_utils_1 = require("../ref-utils");
|
|
6
6
|
const responseCodeRegexp = /^[0-9][0-9Xx]{2}$/;
|
|
@@ -39,7 +39,7 @@ const TagGroup = {
|
|
|
39
39
|
},
|
|
40
40
|
extensionsPrefix: 'x-',
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
exports.ExternalDocs = {
|
|
43
43
|
properties: {
|
|
44
44
|
description: { type: 'string' },
|
|
45
45
|
url: { type: 'string' },
|
|
@@ -339,7 +339,7 @@ const Schema = {
|
|
|
339
339
|
},
|
|
340
340
|
extensionsPrefix: 'x-',
|
|
341
341
|
};
|
|
342
|
-
|
|
342
|
+
exports.Xml = {
|
|
343
343
|
properties: {
|
|
344
344
|
name: { type: 'string' },
|
|
345
345
|
namespace: { type: 'string' },
|
|
@@ -353,7 +353,7 @@ const SchemaProperties = {
|
|
|
353
353
|
properties: {},
|
|
354
354
|
additionalProperties: 'Schema',
|
|
355
355
|
};
|
|
356
|
-
|
|
356
|
+
exports.DiscriminatorMapping = {
|
|
357
357
|
properties: {},
|
|
358
358
|
additionalProperties: (value) => {
|
|
359
359
|
if ((0, ref_utils_1.isMappingRef)(value)) {
|
|
@@ -364,7 +364,7 @@ const DiscriminatorMapping = {
|
|
|
364
364
|
}
|
|
365
365
|
},
|
|
366
366
|
};
|
|
367
|
-
|
|
367
|
+
exports.Discriminator = {
|
|
368
368
|
properties: {
|
|
369
369
|
propertyName: { type: 'string' },
|
|
370
370
|
mapping: 'DiscriminatorMapping',
|
|
@@ -494,7 +494,7 @@ exports.Oas3Types = {
|
|
|
494
494
|
TagList: (0, _1.listOf)('Tag'),
|
|
495
495
|
TagGroups: (0, _1.listOf)('TagGroup'),
|
|
496
496
|
TagGroup,
|
|
497
|
-
ExternalDocs,
|
|
497
|
+
ExternalDocs: exports.ExternalDocs,
|
|
498
498
|
Server,
|
|
499
499
|
ServerList: (0, _1.listOf)('Server'),
|
|
500
500
|
ServerVariable,
|
|
@@ -526,10 +526,10 @@ exports.Oas3Types = {
|
|
|
526
526
|
Link,
|
|
527
527
|
Logo,
|
|
528
528
|
Schema,
|
|
529
|
-
Xml,
|
|
529
|
+
Xml: exports.Xml,
|
|
530
530
|
SchemaProperties,
|
|
531
|
-
DiscriminatorMapping,
|
|
532
|
-
Discriminator,
|
|
531
|
+
DiscriminatorMapping: exports.DiscriminatorMapping,
|
|
532
|
+
Discriminator: exports.Discriminator,
|
|
533
533
|
Components,
|
|
534
534
|
LinksMap: (0, _1.mapOf)('Link'),
|
|
535
535
|
NamedSchemas: (0, _1.mapOf)('Schema'),
|
package/lib/types/oas3_1.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { NodeType } from '.';
|
|
2
2
|
import type { Oas3_1NodeType } from './redocly-yaml';
|
|
3
|
+
export declare const Schema: NodeType;
|
|
4
|
+
export declare const SchemaProperties: NodeType;
|
|
5
|
+
export declare const DependentRequired: NodeType;
|
|
3
6
|
export declare const Oas3_1Types: Record<Oas3_1NodeType, NodeType>;
|
package/lib/types/oas3_1.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Oas3_1Types = void 0;
|
|
3
|
+
exports.Oas3_1Types = exports.DependentRequired = exports.SchemaProperties = exports.Schema = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
5
|
const oas3_1 = require("./oas3");
|
|
6
6
|
const Root = {
|
|
@@ -81,7 +81,7 @@ const Operation = {
|
|
|
81
81
|
},
|
|
82
82
|
extensionsPrefix: 'x-',
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
exports.Schema = {
|
|
85
85
|
properties: {
|
|
86
86
|
$id: { type: 'string' },
|
|
87
87
|
$anchor: { type: 'string' },
|
|
@@ -183,7 +183,7 @@ const Schema = {
|
|
|
183
183
|
},
|
|
184
184
|
extensionsPrefix: 'x-',
|
|
185
185
|
};
|
|
186
|
-
|
|
186
|
+
exports.SchemaProperties = {
|
|
187
187
|
properties: {},
|
|
188
188
|
additionalProperties: (value) => {
|
|
189
189
|
if (typeof value === 'boolean') {
|
|
@@ -263,7 +263,7 @@ const SecurityScheme = {
|
|
|
263
263
|
},
|
|
264
264
|
extensionsPrefix: 'x-',
|
|
265
265
|
};
|
|
266
|
-
|
|
266
|
+
exports.DependentRequired = {
|
|
267
267
|
properties: {},
|
|
268
268
|
additionalProperties: { type: 'array', items: { type: 'string' } },
|
|
269
269
|
};
|
|
@@ -271,13 +271,13 @@ exports.Oas3_1Types = {
|
|
|
271
271
|
...oas3_1.Oas3Types,
|
|
272
272
|
Info,
|
|
273
273
|
Root,
|
|
274
|
-
Schema,
|
|
275
|
-
SchemaProperties,
|
|
276
|
-
PatternProperties: SchemaProperties,
|
|
274
|
+
Schema: exports.Schema,
|
|
275
|
+
SchemaProperties: exports.SchemaProperties,
|
|
276
|
+
PatternProperties: exports.SchemaProperties,
|
|
277
277
|
License,
|
|
278
278
|
Components,
|
|
279
279
|
NamedPathItems: (0, _1.mapOf)('PathItem'),
|
|
280
280
|
SecurityScheme,
|
|
281
281
|
Operation,
|
|
282
|
-
DependentRequired,
|
|
282
|
+
DependentRequired: exports.DependentRequired,
|
|
283
283
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { NodeType } from '.';
|
|
2
1
|
import type { JSONSchema } from 'json-schema-to-ts';
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import type { NodeType } from '.';
|
|
3
|
+
import type { Config } from '../config';
|
|
4
|
+
declare const builtInCommonOASRules: readonly ["spec", "info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "info-license-url", "info-license-strict", "info-license", "no-ambiguous-paths", "no-enum-type-mismatch", "no-http-verbs-in-paths", "no-identical-paths", "no-invalid-parameter-examples", "no-invalid-schema-examples", "no-path-trailing-slash", "operation-2xx-response", "operation-4xx-response", "operation-description", "operation-operationId-unique", "operation-operationId-url-safe", "operation-parameters-unique", "operation-singular-tag", "operation-summary", "operation-tag-defined", "parameter-description", "path-declaration-must-exist", "path-excludes-patterns", "path-http-verbs-order", "path-not-include-query", "path-params-defined", "path-parameters-defined", "path-segment-plural", "paths-kebab-case", "required-string-property-missing-min-length", "response-contains-header", "scalar-property-missing-example", "security-defined", "spec-strict-refs", "no-unresolved-refs", "no-required-schema-properties-undefined"];
|
|
5
5
|
export type BuiltInCommonOASRuleId = typeof builtInCommonOASRules[number];
|
|
6
6
|
declare const builtInOAS2Rules: readonly ["boolean-parameter-prefixes", "request-mime-type", "response-contains-property", "response-mime-type"];
|
|
7
7
|
export type BuiltInOAS2RuleId = typeof builtInOAS2Rules[number];
|
|
8
8
|
declare const builtInOAS3Rules: readonly ["boolean-parameter-prefixes", "component-name-unique", "no-empty-servers", "no-example-value-and-externalValue", "no-invalid-media-type-examples", "no-server-example.com", "no-server-trailing-slash", "no-server-variables-empty-enum", "no-undefined-server-variable", "no-unused-components", "operation-4xx-problem-details-rfc7807", "request-mime-type", "response-contains-property", "response-mime-type", "spec-components-invalid-map-name", "array-parameter-serialization"];
|
|
9
9
|
export type BuiltInOAS3RuleId = typeof builtInOAS3Rules[number];
|
|
10
|
-
declare const builtInAsync2Rules: readonly ["spec", "info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
11
|
-
declare const builtInAsync3Rules: readonly ["spec", "info-contact", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
10
|
+
declare const builtInAsync2Rules: readonly ["spec", "info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
11
|
+
declare const builtInAsync3Rules: readonly ["spec", "info-contact", "info-license-strict", "operation-operationId", "tag-description", "tags-alphabetical", "channels-kebab-case", "no-channel-trailing-slash"];
|
|
12
12
|
export type BuiltInAsync2RuleId = typeof builtInAsync2Rules[number];
|
|
13
13
|
export type BuiltInAsync3RuleId = typeof builtInAsync3Rules[number];
|
|
14
|
-
declare const builtInArazzoRules: readonly ["spec"];
|
|
14
|
+
declare const builtInArazzoRules: readonly ["spec", "parameters-no-body-inside-in"];
|
|
15
15
|
export type BuiltInArazzoRuleId = typeof builtInArazzoRules[number];
|
|
16
16
|
declare const oas2NodeTypesList: readonly ["Root", "Tag", "TagList", "ExternalDocs", "SecurityRequirement", "SecurityRequirementList", "Info", "Contact", "License", "Paths", "PathItem", "Parameter", "ParameterList", "ParameterItems", "Operation", "Example", "ExamplesMap", "Examples", "Header", "Responses", "Response", "Schema", "Xml", "SchemaProperties", "NamedSchemas", "NamedResponses", "NamedParameters", "NamedSecuritySchemes", "SecurityScheme", "TagGroup", "TagGroups", "EnumDescriptions", "Logo", "XCodeSample", "XCodeSampleList", "XServer", "XServerList"];
|
|
17
17
|
export type Oas2NodeType = typeof oas2NodeTypesList[number];
|
|
@@ -14,6 +14,7 @@ const builtInCommonOASRules = [
|
|
|
14
14
|
'tag-description',
|
|
15
15
|
'tags-alphabetical',
|
|
16
16
|
'info-license-url',
|
|
17
|
+
'info-license-strict',
|
|
17
18
|
'info-license',
|
|
18
19
|
'no-ambiguous-paths',
|
|
19
20
|
'no-enum-type-mismatch',
|
|
@@ -75,6 +76,7 @@ const builtInOAS3Rules = [
|
|
|
75
76
|
const builtInAsync2Rules = [
|
|
76
77
|
'spec',
|
|
77
78
|
'info-contact',
|
|
79
|
+
'info-license-strict',
|
|
78
80
|
'operation-operationId',
|
|
79
81
|
'tag-description',
|
|
80
82
|
'tags-alphabetical',
|
|
@@ -84,13 +86,14 @@ const builtInAsync2Rules = [
|
|
|
84
86
|
const builtInAsync3Rules = [
|
|
85
87
|
'spec',
|
|
86
88
|
'info-contact',
|
|
89
|
+
'info-license-strict',
|
|
87
90
|
'operation-operationId',
|
|
88
91
|
'tag-description',
|
|
89
92
|
'tags-alphabetical',
|
|
90
93
|
'channels-kebab-case',
|
|
91
94
|
'no-channel-trailing-slash',
|
|
92
95
|
];
|
|
93
|
-
const builtInArazzoRules = ['spec'];
|
|
96
|
+
const builtInArazzoRules = ['spec', 'parameters-no-body-inside-in'];
|
|
94
97
|
const builtInRules = [
|
|
95
98
|
...builtInCommonOASRules,
|
|
96
99
|
...builtInOAS2Rules,
|
package/lib/typings/arazzo.d.ts
CHANGED
|
@@ -1,30 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
export interface InfoObject {
|
|
2
|
+
title: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
summary?: string;
|
|
5
|
+
version: string;
|
|
6
|
+
}
|
|
7
|
+
export interface OpenAPISourceDescription {
|
|
8
|
+
name: string;
|
|
9
|
+
type: 'openapi';
|
|
10
|
+
url: string;
|
|
11
|
+
'x-serverUrl'?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface NoneSourceDescription {
|
|
14
|
+
name: string;
|
|
15
|
+
type: 'none';
|
|
16
|
+
'x-serverUrl': string;
|
|
17
|
+
}
|
|
18
|
+
export interface ArazzoSourceDescription {
|
|
19
|
+
name: string;
|
|
20
|
+
type: 'arazzo';
|
|
21
|
+
url: string;
|
|
22
|
+
}
|
|
23
|
+
export type SourceDescription = OpenAPISourceDescription | NoneSourceDescription | ArazzoSourceDescription;
|
|
24
|
+
export interface Parameter {
|
|
25
|
+
in?: 'header' | 'query' | 'path' | 'cookie' | 'body';
|
|
26
|
+
name: string;
|
|
27
|
+
value: string | number | boolean;
|
|
28
|
+
reference?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ExtendedOperation {
|
|
21
31
|
path: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
method: 'get' | 'post' | 'put' | 'delete' | 'patch';
|
|
33
|
+
sourceDescriptionName?: string;
|
|
34
|
+
serverUrl?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface ExpectSchema {
|
|
25
37
|
statusCode?: number;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
38
|
+
mimeType?: string;
|
|
39
|
+
body?: any;
|
|
40
|
+
schema?: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface Replacement {
|
|
45
|
+
target: string;
|
|
46
|
+
value: string | object | any[];
|
|
47
|
+
}
|
|
48
|
+
export interface RequestBody {
|
|
49
|
+
contentType?: string;
|
|
50
|
+
payload: string | object | any[];
|
|
51
|
+
encoding?: string;
|
|
52
|
+
replacements?: Replacement[];
|
|
53
|
+
}
|
|
54
|
+
export interface CriteriaObject {
|
|
55
|
+
condition: string;
|
|
56
|
+
context?: string;
|
|
57
|
+
type?: 'regex' | 'jsonpath' | 'simple' | 'xpath' | {
|
|
58
|
+
type: 'jsonpath';
|
|
59
|
+
version: 'draft-goessner-dispatch-jsonpath-00';
|
|
60
|
+
} | {
|
|
61
|
+
type: 'xpath';
|
|
62
|
+
version: 'xpath-30' | 'xpath-20' | 'xpath-10';
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface OnSuccessObject {
|
|
66
|
+
name: string;
|
|
67
|
+
type: 'goto' | 'end';
|
|
68
|
+
stepId?: string;
|
|
69
|
+
workflowId?: string;
|
|
70
|
+
criteria?: CriteriaObject[];
|
|
71
|
+
}
|
|
72
|
+
export interface OnFailureObject {
|
|
73
|
+
name: string;
|
|
74
|
+
type: 'goto' | 'retry' | 'end';
|
|
75
|
+
workflowId?: string;
|
|
76
|
+
stepId?: string;
|
|
77
|
+
retryAfter?: number;
|
|
78
|
+
retryLimit?: number;
|
|
79
|
+
criteria?: CriteriaObject[];
|
|
80
|
+
}
|
|
81
|
+
export interface Step {
|
|
82
|
+
stepId: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
operationId?: string;
|
|
85
|
+
operationPath?: string;
|
|
86
|
+
workflowId?: string;
|
|
87
|
+
parameters?: Parameter[];
|
|
88
|
+
successCriteria?: CriteriaObject[];
|
|
89
|
+
onSuccess?: OnSuccessObject[];
|
|
90
|
+
onFailure?: OnFailureObject[];
|
|
91
|
+
outputs?: {
|
|
92
|
+
[key: string]: string | object | any[] | boolean | number;
|
|
93
|
+
};
|
|
94
|
+
'x-inherit'?: 'auto' | 'none';
|
|
95
|
+
'x-expect'?: ExpectSchema;
|
|
96
|
+
'x-assert'?: string;
|
|
97
|
+
'x-operation'?: ExtendedOperation;
|
|
98
|
+
requestBody?: RequestBody;
|
|
99
|
+
}
|
|
100
|
+
export interface Workflow {
|
|
101
|
+
workflowId: string;
|
|
102
|
+
summary?: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
parameters?: Parameter[];
|
|
105
|
+
dependsOn?: string[];
|
|
106
|
+
inputs?: {
|
|
107
|
+
type: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
108
|
+
properties?: {
|
|
109
|
+
[key: string]: any;
|
|
110
|
+
};
|
|
111
|
+
required?: string[];
|
|
112
|
+
items?: {
|
|
113
|
+
[key: string]: any;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
outputs?: {
|
|
117
|
+
[key: string]: string;
|
|
118
|
+
};
|
|
29
119
|
steps: Step[];
|
|
30
|
-
|
|
120
|
+
successActions?: OnSuccessObject[];
|
|
121
|
+
failureActions?: OnFailureObject[];
|
|
122
|
+
}
|
|
123
|
+
export interface ArazzoDefinition {
|
|
124
|
+
arazzo: '1.0.0';
|
|
125
|
+
info: InfoObject;
|
|
126
|
+
sourceDescriptions: SourceDescription[];
|
|
127
|
+
'x-parameters'?: Parameter[];
|
|
128
|
+
workflows: Workflow[];
|
|
129
|
+
components?: {
|
|
130
|
+
inputs?: {
|
|
131
|
+
[key: string]: {
|
|
132
|
+
type: string;
|
|
133
|
+
properties?: {
|
|
134
|
+
[key: string]: any;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
parameters?: {
|
|
139
|
+
[key: string]: Parameter;
|
|
140
|
+
};
|
|
141
|
+
successActions?: {
|
|
142
|
+
[key: string]: OnSuccessObject;
|
|
143
|
+
};
|
|
144
|
+
failureActions?: {
|
|
145
|
+
[key: string]: OnFailureObject;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
}
|
package/lib/typings/common.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export interface StatsRow {
|
|
|
4
4
|
color: 'red' | 'yellow' | 'green' | 'white' | 'magenta' | 'cyan';
|
|
5
5
|
items?: Set<string>;
|
|
6
6
|
}
|
|
7
|
-
export type StatsName = 'operations' | 'refs' | 'tags' | 'externalDocs' | 'pathItems' | 'links' | 'schemas' | 'parameters';
|
|
7
|
+
export type StatsName = 'operations' | 'refs' | 'tags' | 'externalDocs' | 'pathItems' | 'links' | 'schemas' | 'webhooks' | 'parameters';
|
|
8
8
|
export type StatsAccumulator = Record<StatsName, StatsRow>;
|
package/lib/typings/swagger.d.ts
CHANGED
package/lib/visitors.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { Oas3Definition, Oas3ExternalDocs, Oas3Info, Oas3Contact, Oas3Compo
|
|
|
6
6
|
import type { Oas2Definition, Oas2Tag, Oas2ExternalDocs, Oas2SecurityRequirement, Oas2Info, Oas2Contact, Oas2License, Oas2PathItem, Oas2Operation, Oas2Header, Oas2Response, Oas2Schema, Oas2Xml, Oas2Parameter, Oas2SecurityScheme } from './typings/swagger';
|
|
7
7
|
import type { Async2Definition } from './typings/asyncapi';
|
|
8
8
|
import type { Async3Definition } from './typings/asyncapi3';
|
|
9
|
-
import type { ArazzoDefinition } from './typings/arazzo';
|
|
9
|
+
import type { ArazzoDefinition, ArazzoSourceDescription, CriteriaObject, ExpectSchema, ExtendedOperation, InfoObject, NoneSourceDescription, OnFailureObject, OnSuccessObject, OpenAPISourceDescription, Parameter, Replacement, RequestBody, SourceDescription, Step, Workflow } from './typings/arazzo';
|
|
10
10
|
export type SkipFunctionContext = Pick<UserContext, 'location' | 'rawNode' | 'resolve' | 'rawLocation'>;
|
|
11
11
|
export type VisitFunction<T> = (node: T, ctx: UserContext & {
|
|
12
12
|
ignoreNextVisitorsOnNode: () => void;
|
|
@@ -146,6 +146,23 @@ type Async3FlatVisitor = {
|
|
|
146
146
|
};
|
|
147
147
|
type ArazzoFlatVisitor = {
|
|
148
148
|
Root?: VisitFunctionOrObject<ArazzoDefinition>;
|
|
149
|
+
ParameterObject?: VisitFunctionOrObject<Parameter>;
|
|
150
|
+
InfoObject?: VisitFunctionOrObject<InfoObject>;
|
|
151
|
+
OpenAPISourceDescription?: VisitFunctionOrObject<OpenAPISourceDescription>;
|
|
152
|
+
NoneSourceDescription?: VisitFunctionOrObject<NoneSourceDescription>;
|
|
153
|
+
ArazzoSourceDescription?: VisitFunctionOrObject<ArazzoSourceDescription>;
|
|
154
|
+
SourceDescription?: VisitFunctionOrObject<SourceDescription>;
|
|
155
|
+
ExtendedOperation?: VisitFunctionOrObject<ExtendedOperation>;
|
|
156
|
+
ExpectSchema?: VisitFunctionOrObject<ExpectSchema>;
|
|
157
|
+
Replacement?: VisitFunctionOrObject<Replacement>;
|
|
158
|
+
RequestBody?: VisitFunctionOrObject<RequestBody>;
|
|
159
|
+
CriteriaObject?: VisitFunctionOrObject<CriteriaObject>;
|
|
160
|
+
OnSuccessObject?: VisitFunctionOrObject<OnSuccessObject>;
|
|
161
|
+
OnFailureObject?: VisitFunctionOrObject<OnFailureObject>;
|
|
162
|
+
Step?: VisitFunctionOrObject<Step>;
|
|
163
|
+
Steps?: VisitFunctionOrObject<Step[]>;
|
|
164
|
+
Workflow?: VisitFunctionOrObject<Workflow>;
|
|
165
|
+
Workflows?: VisitFunctionOrObject<Workflow[]>;
|
|
149
166
|
};
|
|
150
167
|
type Oas3NestedVisitor = {
|
|
151
168
|
[T in keyof Oas3FlatVisitor]: Oas3FlatVisitor[T] extends Function ? Oas3FlatVisitor[T] : Oas3FlatVisitor[T] & NestedVisitor<Oas3NestedVisitor>;
|
package/lib/walk.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Location } from './ref-utils';
|
|
2
|
-
import {
|
|
3
|
-
import { SpecVersion } from './oas-types';
|
|
2
|
+
import { YamlParseError } from './resolve';
|
|
3
|
+
import type { SpecVersion } from './oas-types';
|
|
4
|
+
import type { ResolveError, Source, ResolvedRefMap, Document } from './resolve';
|
|
4
5
|
import type { Referenced } from './typings/openapi';
|
|
5
6
|
import type { NormalizedOasVisitors, BaseVisitor } from './visitors';
|
|
6
|
-
import type { ResolvedRefMap, Document } from './resolve';
|
|
7
7
|
import type { NormalizedNodeType } from './types';
|
|
8
8
|
import type { RuleSeverity } from './config';
|
|
9
9
|
export type NonUndefined = string | number | boolean | symbol | bigint | object | Record<string, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@redocly/ajv": "^8.11.0",
|
|
39
|
-
"@redocly/config": "^0.
|
|
39
|
+
"@redocly/config": "^0.9.0",
|
|
40
40
|
"colorette": "^1.2.0",
|
|
41
41
|
"https-proxy-agent": "^7.0.4",
|
|
42
42
|
"js-levenshtein": "^1.1.6",
|
|
@@ -164,7 +164,7 @@ describe('bundle', () => {
|
|
|
164
164
|
''
|
|
165
165
|
);
|
|
166
166
|
|
|
167
|
-
const config = await makeConfig({}, { 'registry-dependencies': 'on' });
|
|
167
|
+
const config = await makeConfig({ rules: {}, decorators: { 'registry-dependencies': 'on' } });
|
|
168
168
|
|
|
169
169
|
const {
|
|
170
170
|
bundle: result,
|
|
@@ -205,7 +205,7 @@ describe('bundle', () => {
|
|
|
205
205
|
''
|
|
206
206
|
);
|
|
207
207
|
|
|
208
|
-
const config = await makeConfig({});
|
|
208
|
+
const config = await makeConfig({ rules: {} });
|
|
209
209
|
|
|
210
210
|
const {
|
|
211
211
|
bundle: { parsed },
|
|
@@ -305,7 +305,7 @@ describe('bundle async', () => {
|
|
|
305
305
|
''
|
|
306
306
|
);
|
|
307
307
|
|
|
308
|
-
const config = await makeConfig({});
|
|
308
|
+
const config = await makeConfig({ rules: {} });
|
|
309
309
|
|
|
310
310
|
const {
|
|
311
311
|
bundle: { parsed },
|
|
@@ -375,7 +375,7 @@ describe('bundle async', () => {
|
|
|
375
375
|
''
|
|
376
376
|
);
|
|
377
377
|
|
|
378
|
-
const config = await makeConfig({});
|
|
378
|
+
const config = await makeConfig({ rules: {} });
|
|
379
379
|
|
|
380
380
|
const {
|
|
381
381
|
bundle: { parsed },
|
|
@@ -127,7 +127,7 @@ const testPortalConfig = parseYamlToDocument(
|
|
|
127
127
|
# serviceAccountPrivateKey: Must be reported as a missing required prop
|
|
128
128
|
serviceAccountEmail: 789 # Must be a string
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
l10n:
|
|
131
131
|
defaultLocale: en-US
|
|
132
132
|
locales:
|
|
133
133
|
- code: 123 # Must be a string
|
|
@@ -201,18 +201,14 @@ const testPortalConfig = parseYamlToDocument(
|
|
|
201
201
|
graphql:
|
|
202
202
|
pagination: section
|
|
203
203
|
menu:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
otherItemsGroupName: 'Other',
|
|
215
|
-
}
|
|
204
|
+
requireExactGroups: false
|
|
205
|
+
groups:
|
|
206
|
+
- name: 'GraphQL custom group'
|
|
207
|
+
directives:
|
|
208
|
+
includeByName:
|
|
209
|
+
- cacheControl
|
|
210
|
+
- typeDirective
|
|
211
|
+
otherItemsGroupName: 'Other'
|
|
216
212
|
sidebar:
|
|
217
213
|
separatorLine: true
|
|
218
214
|
linePosition: top
|
|
@@ -1048,7 +1044,7 @@ describe('lint', () => {
|
|
|
1048
1044
|
"from": undefined,
|
|
1049
1045
|
"location": [
|
|
1050
1046
|
{
|
|
1051
|
-
"pointer": "#/
|
|
1047
|
+
"pointer": "#/l10n/locales/0/code",
|
|
1052
1048
|
"reportOnKey": false,
|
|
1053
1049
|
"source": "",
|
|
1054
1050
|
},
|
|
@@ -1252,12 +1248,12 @@ describe('lint', () => {
|
|
|
1252
1248
|
"from": undefined,
|
|
1253
1249
|
"location": [
|
|
1254
1250
|
{
|
|
1255
|
-
"pointer": "#/
|
|
1251
|
+
"pointer": "#/l10n",
|
|
1256
1252
|
"reportOnKey": true,
|
|
1257
1253
|
"source": "",
|
|
1258
1254
|
},
|
|
1259
1255
|
],
|
|
1260
|
-
"message": "Property \`
|
|
1256
|
+
"message": "Property \`l10n\` is not expected here.",
|
|
1261
1257
|
"ruleId": "configuration spec",
|
|
1262
1258
|
"severity": "error",
|
|
1263
1259
|
"suggest": [],
|
|
@@ -1413,7 +1409,7 @@ describe('lint', () => {
|
|
|
1413
1409
|
const results = await lintDocument({
|
|
1414
1410
|
externalRefResolver: new BaseResolver(),
|
|
1415
1411
|
document,
|
|
1416
|
-
config: await makeConfig({ spec: 'error' }),
|
|
1412
|
+
config: await makeConfig({ rules: { spec: 'error' } }),
|
|
1417
1413
|
});
|
|
1418
1414
|
|
|
1419
1415
|
expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
|
|
@@ -1492,7 +1488,7 @@ describe('lint', () => {
|
|
|
1492
1488
|
const results = await lintDocument({
|
|
1493
1489
|
externalRefResolver: new BaseResolver(),
|
|
1494
1490
|
document,
|
|
1495
|
-
config: await makeConfig({ spec: 'error' }),
|
|
1491
|
+
config: await makeConfig({ rules: { spec: 'error' } }),
|
|
1496
1492
|
});
|
|
1497
1493
|
|
|
1498
1494
|
expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
|
|
@@ -1528,7 +1524,11 @@ describe('lint', () => {
|
|
|
1528
1524
|
const result = await lintDocument({
|
|
1529
1525
|
externalRefResolver: new BaseResolver(),
|
|
1530
1526
|
document,
|
|
1531
|
-
config: await makeConfig({
|
|
1527
|
+
config: await makeConfig({
|
|
1528
|
+
rules: { 'operation-operationId': 'error' },
|
|
1529
|
+
decorators: undefined,
|
|
1530
|
+
configPath: configFilePath,
|
|
1531
|
+
}),
|
|
1532
1532
|
});
|
|
1533
1533
|
expect(result).toHaveLength(1);
|
|
1534
1534
|
expect(result).toMatchObject([
|
|
@@ -1590,7 +1590,11 @@ describe('lint', () => {
|
|
|
1590
1590
|
const results = await lintDocument({
|
|
1591
1591
|
externalRefResolver: new BaseResolver(),
|
|
1592
1592
|
document,
|
|
1593
|
-
config: await makeConfig({
|
|
1593
|
+
config: await makeConfig({
|
|
1594
|
+
rules: { spec: 'error' },
|
|
1595
|
+
decorators: undefined,
|
|
1596
|
+
configPath: configFilePath,
|
|
1597
|
+
}),
|
|
1594
1598
|
});
|
|
1595
1599
|
|
|
1596
1600
|
expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`
|
|
@@ -1662,7 +1666,11 @@ describe('lint', () => {
|
|
|
1662
1666
|
const results = await lintDocument({
|
|
1663
1667
|
externalRefResolver: new BaseResolver(),
|
|
1664
1668
|
document,
|
|
1665
|
-
config: await makeConfig({
|
|
1669
|
+
config: await makeConfig({
|
|
1670
|
+
rules: { spec: 'error' },
|
|
1671
|
+
decorators: undefined,
|
|
1672
|
+
configPath: configFilePath,
|
|
1673
|
+
}),
|
|
1666
1674
|
});
|
|
1667
1675
|
|
|
1668
1676
|
expect(replaceSourceWithRef(results)).toMatchInlineSnapshot(`[]`);
|