@redocly/openapi-core 0.0.0-snapshot.1777557756 → 0.0.0-snapshot.1777564281
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/README.md +42 -4
- package/lib/bundle/bundle-document.d.ts +33 -0
- package/lib/bundle/bundle-document.d.ts.map +1 -0
- package/lib/bundle/bundle-document.js +100 -0
- package/lib/bundle/bundle-document.js.map +1 -0
- package/lib/bundle/bundle-oas.d.ts +14 -0
- package/lib/bundle/bundle-oas.d.ts.map +1 -0
- package/lib/bundle/bundle-oas.js +55 -0
- package/lib/bundle/bundle-oas.js.map +1 -0
- package/lib/bundle/bundle-visitor.d.ts +14 -0
- package/lib/bundle/bundle-visitor.d.ts.map +1 -0
- package/lib/bundle/bundle-visitor.js +260 -0
- package/lib/bundle/bundle-visitor.js.map +1 -0
- package/lib/bundle/bundle.d.ts +26 -0
- package/lib/bundle/bundle.d.ts.map +1 -0
- package/lib/bundle/bundle.js +74 -0
- package/lib/bundle/bundle.js.map +1 -0
- package/lib/config/all.d.ts +3 -2
- package/lib/config/all.d.ts.map +1 -0
- package/lib/config/all.js +106 -24
- package/lib/config/all.js.map +1 -0
- package/lib/config/builtIn.d.ts +3 -2
- package/lib/config/builtIn.d.ts.map +1 -0
- package/lib/config/builtIn.js +49 -49
- package/lib/config/builtIn.js.map +1 -0
- package/lib/config/bundle-extends.d.ts +8 -0
- package/lib/config/bundle-extends.d.ts.map +1 -0
- package/lib/config/bundle-extends.js +28 -0
- package/lib/config/bundle-extends.js.map +1 -0
- package/lib/config/config-resolvers.d.ts +19 -27
- package/lib/config/config-resolvers.d.ts.map +1 -0
- package/lib/config/config-resolvers.js +284 -413
- package/lib/config/config-resolvers.js.map +1 -0
- package/lib/config/config.d.ts +25 -30
- package/lib/config/config.d.ts.map +1 -0
- package/lib/config/config.js +149 -131
- package/lib/config/config.js.map +1 -0
- package/lib/config/constants.d.ts +10 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +13 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/get-resolve-config.d.ts +3 -0
- package/lib/config/get-resolve-config.d.ts.map +1 -0
- package/lib/config/get-resolve-config.js +9 -0
- package/lib/config/get-resolve-config.js.map +1 -0
- package/lib/config/group-assertion-rules.d.ts +3 -0
- package/lib/config/group-assertion-rules.d.ts.map +1 -0
- package/lib/config/group-assertion-rules.js +51 -0
- package/lib/config/group-assertion-rules.js.map +1 -0
- package/lib/config/index.d.ts +8 -7
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/index.js +8 -23
- package/lib/config/index.js.map +1 -0
- package/lib/config/load.d.ts +8 -27
- package/lib/config/load.d.ts.map +1 -0
- package/lib/config/load.js +82 -124
- package/lib/config/load.js.map +1 -0
- package/lib/config/minimal.d.ts +3 -2
- package/lib/config/minimal.d.ts.map +1 -0
- package/lib/config/minimal.js +161 -76
- package/lib/config/minimal.js.map +1 -0
- package/lib/config/recommended-strict.d.ts +3 -2
- package/lib/config/recommended-strict.d.ts.map +1 -0
- package/lib/config/recommended-strict.js +161 -76
- package/lib/config/recommended-strict.js.map +1 -0
- package/lib/config/recommended.d.ts +3 -2
- package/lib/config/recommended.d.ts.map +1 -0
- package/lib/config/recommended.js +161 -76
- package/lib/config/recommended.js.map +1 -0
- package/lib/config/rules.d.ts +5 -4
- package/lib/config/rules.d.ts.map +1 -0
- package/lib/config/rules.js +4 -6
- package/lib/config/rules.js.map +1 -0
- package/lib/config/spec.d.ts +3 -2
- package/lib/config/spec.d.ts.map +1 -0
- package/lib/config/spec.js +281 -19
- package/lib/config/spec.js.map +1 -0
- package/lib/config/types.d.ts +53 -90
- package/lib/config/types.d.ts.map +1 -0
- package/lib/config/types.js +2 -2
- package/lib/config/types.js.map +1 -0
- package/lib/config/utils.d.ts +5 -10
- package/lib/config/utils.d.ts.map +1 -0
- package/lib/config/utils.js +75 -266
- package/lib/config/utils.js.map +1 -0
- package/lib/config/visitors.d.ts +50 -0
- package/lib/config/visitors.d.ts.map +1 -0
- package/lib/config/visitors.js +99 -0
- package/lib/config/visitors.js.map +1 -0
- package/lib/decorators/arazzo/index.d.ts +1 -0
- package/lib/decorators/arazzo/index.d.ts.map +1 -0
- package/lib/decorators/arazzo/index.js +2 -4
- package/lib/decorators/arazzo/index.js.map +1 -0
- package/lib/decorators/async2/index.d.ts +1 -0
- package/lib/decorators/async2/index.d.ts.map +1 -0
- package/lib/decorators/async2/index.js +2 -4
- package/lib/decorators/async2/index.js.map +1 -0
- package/lib/decorators/async3/index.d.ts +1 -0
- package/lib/decorators/async3/index.d.ts.map +1 -0
- package/lib/decorators/async3/index.js +2 -4
- package/lib/decorators/async3/index.js.map +1 -0
- package/lib/decorators/common/filters/filter-helper.d.ts +3 -2
- package/lib/decorators/common/filters/filter-helper.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-helper.js +11 -13
- package/lib/decorators/common/filters/filter-helper.js.map +1 -0
- package/lib/decorators/common/filters/filter-in.d.ts +2 -1
- package/lib/decorators/common/filters/filter-in.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-in.js +58 -8
- package/lib/decorators/common/filters/filter-in.js.map +1 -0
- package/lib/decorators/common/filters/filter-out.d.ts +2 -1
- package/lib/decorators/common/filters/filter-out.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-out.js +58 -8
- package/lib/decorators/common/filters/filter-out.js.map +1 -0
- package/lib/decorators/common/info-description-override.d.ts +2 -1
- package/lib/decorators/common/info-description-override.d.ts.map +1 -0
- package/lib/decorators/common/info-description-override.js +5 -8
- package/lib/decorators/common/info-description-override.js.map +1 -0
- package/lib/decorators/common/info-override.d.ts +2 -1
- package/lib/decorators/common/info-override.d.ts.map +1 -0
- package/lib/decorators/common/info-override.js +4 -6
- package/lib/decorators/common/info-override.js.map +1 -0
- package/lib/decorators/common/operation-description-override.d.ts +2 -1
- package/lib/decorators/common/operation-description-override.d.ts.map +1 -0
- package/lib/decorators/common/operation-description-override.js +6 -8
- package/lib/decorators/common/operation-description-override.js.map +1 -0
- package/lib/decorators/common/remove-x-internal.d.ts +2 -1
- package/lib/decorators/common/remove-x-internal.d.ts.map +1 -0
- package/lib/decorators/common/remove-x-internal.js +13 -14
- package/lib/decorators/common/remove-x-internal.js.map +1 -0
- package/lib/decorators/common/tag-description-override.d.ts +2 -1
- package/lib/decorators/common/tag-description-override.d.ts.map +1 -0
- package/lib/decorators/common/tag-description-override.js +7 -9
- package/lib/decorators/common/tag-description-override.js.map +1 -0
- package/lib/decorators/oas2/index.d.ts +3 -11
- package/lib/decorators/oas2/index.d.ts.map +1 -0
- package/lib/decorators/oas2/index.js +18 -20
- package/lib/decorators/oas2/index.js.map +1 -0
- package/lib/decorators/oas2/remove-unused-components.d.ts +2 -1
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +1 -0
- package/lib/decorators/oas2/remove-unused-components.js +51 -43
- package/lib/decorators/oas2/remove-unused-components.js.map +1 -0
- package/lib/decorators/oas3/index.d.ts +3 -12
- package/lib/decorators/oas3/index.d.ts.map +1 -0
- package/lib/decorators/oas3/index.js +20 -22
- package/lib/decorators/oas3/index.js.map +1 -0
- package/lib/decorators/oas3/media-type-examples-override.d.ts +3 -0
- package/lib/decorators/oas3/media-type-examples-override.d.ts.map +1 -0
- package/lib/decorators/{common → oas3}/media-type-examples-override.js +9 -10
- package/lib/decorators/oas3/media-type-examples-override.js.map +1 -0
- package/lib/decorators/oas3/remove-unused-components.d.ts +2 -1
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +1 -0
- package/lib/decorators/oas3/remove-unused-components.js +67 -47
- package/lib/decorators/oas3/remove-unused-components.js.map +1 -0
- package/lib/decorators/openrpc/index.d.ts +2 -0
- package/lib/decorators/openrpc/index.d.ts.map +1 -0
- package/lib/decorators/openrpc/index.js +2 -0
- package/lib/decorators/openrpc/index.js.map +1 -0
- package/lib/decorators/overlay1/index.d.ts +1 -0
- package/lib/decorators/overlay1/index.d.ts.map +1 -0
- package/lib/decorators/overlay1/index.js +2 -4
- package/lib/decorators/overlay1/index.js.map +1 -0
- package/lib/detect-spec.d.ts +5 -0
- package/lib/detect-spec.d.ts.map +1 -0
- package/lib/detect-spec.js +79 -0
- package/lib/detect-spec.js.map +1 -0
- package/lib/env.d.ts +1 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +3 -5
- package/lib/env.js.map +1 -0
- package/lib/errors/yaml-parse-error.d.ts +9 -0
- package/lib/errors/yaml-parse-error.d.ts.map +1 -0
- package/lib/errors/yaml-parse-error.js +18 -0
- package/lib/errors/yaml-parse-error.js.map +1 -0
- package/lib/format/codeframes.d.ts +2 -1
- package/lib/format/codeframes.d.ts.map +1 -0
- package/lib/format/codeframes.js +15 -23
- package/lib/format/codeframes.js.map +1 -0
- package/lib/format/format.d.ts +5 -2
- package/lib/format/format.d.ts.map +1 -0
- package/lib/format/format.js +68 -66
- package/lib/format/format.js.map +1 -0
- package/lib/index.d.ts +59 -26
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +50 -98
- package/lib/index.js.map +1 -0
- package/lib/js-yaml/index.d.ts +2 -1
- package/lib/js-yaml/index.d.ts.map +1 -0
- package/lib/js-yaml/index.js +7 -11
- package/lib/js-yaml/index.js.map +1 -0
- package/lib/lint-entity.d.ts +24 -0
- package/lib/lint-entity.d.ts.map +1 -0
- package/lib/lint-entity.js +171 -0
- package/lib/lint-entity.js.map +1 -0
- package/lib/lint.d.ts +11 -13
- package/lib/lint.d.ts.map +1 -0
- package/lib/lint.js +56 -51
- package/lib/lint.js.map +1 -0
- package/lib/logger.d.ts +15 -2
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +42 -17
- package/lib/logger.js.map +1 -0
- package/lib/oas-types.d.ts +869 -40
- package/lib/oas-types.d.ts.map +1 -0
- package/lib/oas-types.js +31 -98
- package/lib/oas-types.js.map +1 -0
- package/lib/ref-utils.d.ts +12 -5
- package/lib/ref-utils.d.ts.map +1 -0
- package/lib/ref-utils.js +71 -44
- package/lib/ref-utils.js.map +1 -0
- package/lib/resolve.d.ts +9 -19
- package/lib/resolve.d.ts.map +1 -0
- package/lib/resolve.js +85 -87
- package/lib/resolve.js.map +1 -0
- package/lib/rules/ajv.d.ts +14 -4
- package/lib/rules/ajv.d.ts.map +1 -0
- package/lib/rules/ajv.js +54 -29
- package/lib/rules/ajv.js.map +1 -0
- package/lib/rules/arazzo/criteria-unique.d.ts +2 -1
- package/lib/rules/arazzo/criteria-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/criteria-unique.js +2 -5
- package/lib/rules/arazzo/criteria-unique.js.map +1 -0
- package/lib/rules/arazzo/index.d.ts +2 -1
- package/lib/rules/arazzo/index.d.ts.map +1 -0
- package/lib/rules/arazzo/index.js +53 -35
- package/lib/rules/arazzo/index.js.map +1 -0
- package/lib/rules/arazzo/outputs-defined.d.ts +3 -0
- package/lib/rules/arazzo/outputs-defined.d.ts.map +1 -0
- package/lib/rules/arazzo/outputs-defined.js +139 -0
- package/lib/rules/arazzo/outputs-defined.js.map +1 -0
- package/lib/rules/arazzo/parameters-unique.d.ts +2 -1
- package/lib/rules/arazzo/parameters-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/parameters-unique.js +3 -8
- package/lib/rules/arazzo/parameters-unique.js.map +1 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +2 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/requestBody-replacements-unique.js +2 -5
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +1 -0
- package/lib/rules/arazzo/sourceDescription-type.d.ts +2 -1
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescription-type.js +2 -5
- package/lib/rules/arazzo/sourceDescription-type.js.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +2 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +2 -5
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +2 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +1 -0
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +2 -5
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +1 -0
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +2 -1
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/step-onFailure-unique.js +3 -8
- package/lib/rules/arazzo/step-onFailure-unique.js.map +1 -0
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +2 -1
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/step-onSuccess-unique.js +3 -8
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +1 -0
- package/lib/rules/arazzo/stepId-unique.d.ts +2 -1
- package/lib/rules/arazzo/stepId-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/stepId-unique.js +2 -5
- package/lib/rules/arazzo/stepId-unique.js.map +1 -0
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +2 -1
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +1 -0
- package/lib/rules/arazzo/workflow-dependsOn.js +2 -5
- package/lib/rules/arazzo/workflow-dependsOn.js.map +1 -0
- package/lib/rules/arazzo/workflowId-unique.d.ts +2 -1
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +1 -0
- package/lib/rules/arazzo/workflowId-unique.js +2 -5
- package/lib/rules/arazzo/workflowId-unique.js.map +1 -0
- package/lib/rules/async2/channels-kebab-case.d.ts +2 -1
- package/lib/rules/async2/channels-kebab-case.d.ts.map +1 -0
- package/lib/rules/async2/channels-kebab-case.js +2 -5
- package/lib/rules/async2/channels-kebab-case.js.map +1 -0
- package/lib/rules/async2/index.d.ts +2 -1
- package/lib/rules/async2/index.d.ts.map +1 -0
- package/lib/rules/async2/index.js +33 -26
- package/lib/rules/async2/index.js.map +1 -0
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +2 -1
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +1 -0
- package/lib/rules/async2/no-channel-trailing-slash.js +2 -5
- package/lib/rules/async2/no-channel-trailing-slash.js.map +1 -0
- package/lib/rules/async3/channels-kebab-case.d.ts +2 -1
- package/lib/rules/async3/channels-kebab-case.d.ts.map +1 -0
- package/lib/rules/async3/channels-kebab-case.js +2 -5
- package/lib/rules/async3/channels-kebab-case.js.map +1 -0
- package/lib/rules/async3/index.d.ts +2 -1
- package/lib/rules/async3/index.d.ts.map +1 -0
- package/lib/rules/async3/index.js +33 -26
- package/lib/rules/async3/index.js.map +1 -0
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +2 -1
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +1 -0
- package/lib/rules/async3/no-channel-trailing-slash.js +3 -6
- package/lib/rules/async3/no-channel-trailing-slash.js.map +1 -0
- package/lib/rules/catalog-entity/entity-key-valid.d.ts +3 -0
- package/lib/rules/catalog-entity/entity-key-valid.d.ts.map +1 -0
- package/lib/rules/catalog-entity/entity-key-valid.js +39 -0
- package/lib/rules/catalog-entity/entity-key-valid.js.map +1 -0
- package/lib/rules/common/assertions/asserts.d.ts +4 -3
- package/lib/rules/common/assertions/asserts.d.ts.map +1 -0
- package/lib/rules/common/assertions/asserts.js +56 -53
- package/lib/rules/common/assertions/asserts.js.map +1 -0
- package/lib/rules/common/assertions/index.d.ts +5 -3
- package/lib/rules/common/assertions/index.d.ts.map +1 -0
- package/lib/rules/common/assertions/index.js +9 -11
- package/lib/rules/common/assertions/index.js.map +1 -0
- package/lib/rules/common/assertions/utils.d.ts +5 -12
- package/lib/rules/common/assertions/utils.d.ts.map +1 -0
- package/lib/rules/common/assertions/utils.js +54 -64
- package/lib/rules/common/assertions/utils.js.map +1 -0
- package/lib/rules/common/info-contact.d.ts +2 -1
- package/lib/rules/common/info-contact.d.ts.map +1 -0
- package/lib/rules/common/info-contact.js +4 -7
- package/lib/rules/common/info-contact.js.map +1 -0
- package/lib/rules/common/info-license-strict.d.ts +2 -1
- package/lib/rules/common/info-license-strict.d.ts.map +1 -0
- package/lib/rules/common/info-license-strict.js +8 -11
- package/lib/rules/common/info-license-strict.js.map +1 -0
- package/lib/rules/common/info-license.d.ts +2 -1
- package/lib/rules/common/info-license.d.ts.map +1 -0
- package/lib/rules/common/info-license.js +4 -7
- package/lib/rules/common/info-license.js.map +1 -0
- package/lib/rules/common/no-ambiguous-paths.d.ts +2 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +1 -0
- package/lib/rules/common/no-ambiguous-paths.js +2 -5
- package/lib/rules/common/no-ambiguous-paths.js.map +1 -0
- package/lib/rules/common/no-duplicated-tag-names.d.ts +3 -0
- package/lib/rules/common/no-duplicated-tag-names.d.ts.map +1 -0
- package/lib/rules/common/no-duplicated-tag-names.js +21 -0
- package/lib/rules/common/no-duplicated-tag-names.js.map +1 -0
- package/lib/rules/common/no-enum-type-mismatch.d.ts +3 -2
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +1 -0
- package/lib/rules/common/no-enum-type-mismatch.js +6 -9
- package/lib/rules/common/no-enum-type-mismatch.js.map +1 -0
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +2 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +1 -0
- package/lib/rules/common/no-http-verbs-in-paths.js +8 -8
- package/lib/rules/common/no-http-verbs-in-paths.js.map +1 -0
- package/lib/rules/common/no-identical-paths.d.ts +2 -1
- package/lib/rules/common/no-identical-paths.d.ts.map +1 -0
- package/lib/rules/common/no-identical-paths.js +2 -5
- package/lib/rules/common/no-identical-paths.js.map +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +3 -1
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.js +20 -12
- package/lib/rules/common/no-invalid-parameter-examples.js.map +1 -0
- package/lib/rules/common/no-invalid-schema-examples.d.ts +2 -1
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +1 -0
- package/lib/rules/common/no-invalid-schema-examples.js +16 -11
- package/lib/rules/common/no-invalid-schema-examples.js.map +1 -0
- package/lib/rules/common/no-mixed-number-range-constraints.d.ts +3 -0
- package/lib/rules/common/no-mixed-number-range-constraints.d.ts.map +1 -0
- package/lib/rules/common/no-mixed-number-range-constraints.js +19 -0
- package/lib/rules/common/no-mixed-number-range-constraints.js.map +1 -0
- package/lib/rules/common/no-path-trailing-slash.d.ts +2 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +1 -0
- package/lib/rules/common/no-path-trailing-slash.js +2 -5
- package/lib/rules/common/no-path-trailing-slash.js.map +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +3 -2
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.js +51 -23
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +1 -0
- package/lib/rules/common/no-schema-type-mismatch.d.ts +3 -2
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +1 -0
- package/lib/rules/common/no-schema-type-mismatch.js +2 -5
- package/lib/rules/common/no-schema-type-mismatch.js.map +1 -0
- package/lib/rules/common/no-unresolved-refs.d.ts +6 -0
- package/lib/rules/common/no-unresolved-refs.d.ts.map +1 -0
- package/lib/rules/{no-unresolved-refs.js → common/no-unresolved-refs.js} +5 -9
- package/lib/rules/common/no-unresolved-refs.js.map +1 -0
- package/lib/rules/common/operation-2xx-response.d.ts +2 -1
- package/lib/rules/common/operation-2xx-response.d.ts.map +1 -0
- package/lib/rules/common/operation-2xx-response.js +5 -8
- package/lib/rules/common/operation-2xx-response.js.map +1 -0
- package/lib/rules/common/operation-4xx-response.d.ts +2 -1
- package/lib/rules/common/operation-4xx-response.d.ts.map +1 -0
- package/lib/rules/common/operation-4xx-response.js +5 -8
- package/lib/rules/common/operation-4xx-response.js.map +1 -0
- package/lib/rules/common/operation-description.d.ts +2 -1
- package/lib/rules/common/operation-description.d.ts.map +1 -0
- package/lib/rules/common/operation-description.js +4 -7
- package/lib/rules/common/operation-description.js.map +1 -0
- package/lib/rules/common/operation-operationId-unique.d.ts +2 -1
- package/lib/rules/common/operation-operationId-unique.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId-unique.js +2 -5
- package/lib/rules/common/operation-operationId-unique.js.map +1 -0
- package/lib/rules/common/operation-operationId-url-safe.d.ts +2 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId-url-safe.js +2 -5
- package/lib/rules/common/operation-operationId-url-safe.js.map +1 -0
- package/lib/rules/common/operation-operationId.d.ts +2 -1
- package/lib/rules/common/operation-operationId.d.ts.map +1 -0
- package/lib/rules/common/operation-operationId.js +4 -7
- package/lib/rules/common/operation-operationId.js.map +1 -0
- package/lib/rules/common/operation-parameters-unique.d.ts +2 -1
- package/lib/rules/common/operation-parameters-unique.d.ts.map +1 -0
- package/lib/rules/common/operation-parameters-unique.js +2 -5
- package/lib/rules/common/operation-parameters-unique.js.map +1 -0
- package/lib/rules/common/operation-singular-tag.d.ts +2 -1
- package/lib/rules/common/operation-singular-tag.d.ts.map +1 -0
- package/lib/rules/common/operation-singular-tag.js +2 -5
- package/lib/rules/common/operation-singular-tag.js.map +1 -0
- package/lib/rules/common/operation-summary.d.ts +2 -1
- package/lib/rules/common/operation-summary.d.ts.map +1 -0
- package/lib/rules/common/operation-summary.js +4 -7
- package/lib/rules/common/operation-summary.js.map +1 -0
- package/lib/rules/common/operation-tag-defined.d.ts +2 -1
- package/lib/rules/common/operation-tag-defined.d.ts.map +1 -0
- package/lib/rules/common/operation-tag-defined.js +2 -5
- package/lib/rules/common/operation-tag-defined.js.map +1 -0
- package/lib/rules/common/parameter-description.d.ts +2 -1
- package/lib/rules/common/parameter-description.d.ts.map +1 -0
- package/lib/rules/common/parameter-description.js +2 -5
- package/lib/rules/common/parameter-description.js.map +1 -0
- package/lib/rules/common/path-declaration-must-exist.d.ts +2 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +1 -0
- package/lib/rules/common/path-declaration-must-exist.js +2 -5
- package/lib/rules/common/path-declaration-must-exist.js.map +1 -0
- package/lib/rules/common/path-http-verbs-order.d.ts +2 -1
- package/lib/rules/common/path-http-verbs-order.d.ts.map +1 -0
- package/lib/rules/common/path-http-verbs-order.js +3 -6
- package/lib/rules/common/path-http-verbs-order.js.map +1 -0
- package/lib/rules/common/path-not-include-query.d.ts +2 -1
- package/lib/rules/common/path-not-include-query.d.ts.map +1 -0
- package/lib/rules/common/path-not-include-query.js +2 -5
- package/lib/rules/common/path-not-include-query.js.map +1 -0
- package/lib/rules/common/path-params-defined.d.ts +2 -1
- package/lib/rules/common/path-params-defined.d.ts.map +1 -0
- package/lib/rules/common/path-params-defined.js +137 -50
- package/lib/rules/common/path-params-defined.js.map +1 -0
- package/lib/rules/common/path-segment-plural.d.ts +2 -1
- package/lib/rules/common/path-segment-plural.d.ts.map +1 -0
- package/lib/rules/common/path-segment-plural.js +6 -9
- package/lib/rules/common/path-segment-plural.js.map +1 -0
- package/lib/rules/common/paths-kebab-case.d.ts +2 -1
- package/lib/rules/common/paths-kebab-case.d.ts.map +1 -0
- package/lib/rules/common/paths-kebab-case.js +2 -5
- package/lib/rules/common/paths-kebab-case.js.map +1 -0
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +2 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +1 -0
- package/lib/rules/common/required-string-property-missing-min-length.js +2 -5
- package/lib/rules/common/required-string-property-missing-min-length.js.map +1 -0
- package/lib/rules/common/response-contains-header.d.ts +2 -1
- package/lib/rules/common/response-contains-header.d.ts.map +1 -0
- package/lib/rules/common/response-contains-header.js +5 -8
- package/lib/rules/common/response-contains-header.js.map +1 -0
- package/lib/rules/common/scalar-property-missing-example.d.ts +2 -1
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +1 -0
- package/lib/rules/common/scalar-property-missing-example.js +6 -9
- package/lib/rules/common/scalar-property-missing-example.js.map +1 -0
- package/lib/rules/common/security-defined.d.ts +2 -1
- package/lib/rules/common/security-defined.d.ts.map +1 -0
- package/lib/rules/common/security-defined.js +2 -5
- package/lib/rules/common/security-defined.js.map +1 -0
- package/lib/rules/common/spec-strict-refs.d.ts +2 -1
- package/lib/rules/common/spec-strict-refs.d.ts.map +1 -0
- package/lib/rules/common/spec-strict-refs.js +4 -7
- package/lib/rules/common/spec-strict-refs.js.map +1 -0
- package/lib/rules/common/struct.d.ts +3 -2
- package/lib/rules/common/struct.d.ts.map +1 -0
- package/lib/rules/common/struct.js +20 -28
- package/lib/rules/common/struct.js.map +1 -0
- package/lib/rules/common/tag-description.d.ts +2 -1
- package/lib/rules/common/tag-description.d.ts.map +1 -0
- package/lib/rules/common/tag-description.js +4 -7
- package/lib/rules/common/tag-description.js.map +1 -0
- package/lib/rules/common/tags-alphabetical.d.ts +2 -1
- package/lib/rules/common/tags-alphabetical.d.ts.map +1 -0
- package/lib/rules/common/tags-alphabetical.js +3 -8
- package/lib/rules/common/tags-alphabetical.js.map +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +2 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +1 -0
- package/lib/rules/oas2/boolean-parameter-prefixes.js +2 -5
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +1 -0
- package/lib/rules/oas2/index.d.ts +2 -1
- package/lib/rules/oas2/index.d.ts.map +1 -0
- package/lib/rules/oas2/index.js +92 -99
- package/lib/rules/oas2/index.js.map +1 -0
- package/lib/rules/oas2/request-mime-type.d.ts +2 -1
- package/lib/rules/oas2/request-mime-type.d.ts.map +1 -0
- package/lib/rules/oas2/request-mime-type.js +5 -8
- package/lib/rules/oas2/request-mime-type.js.map +1 -0
- package/lib/rules/oas2/response-contains-property.d.ts +2 -1
- package/lib/rules/oas2/response-contains-property.d.ts.map +1 -0
- package/lib/rules/oas2/response-contains-property.js +5 -8
- package/lib/rules/oas2/response-contains-property.js.map +1 -0
- package/lib/rules/oas2/response-mime-type.d.ts +2 -1
- package/lib/rules/oas2/response-mime-type.d.ts.map +1 -0
- package/lib/rules/oas2/response-mime-type.js +5 -8
- package/lib/rules/oas2/response-mime-type.js.map +1 -0
- package/lib/rules/oas3/array-parameter-serialization.d.ts +2 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +1 -0
- package/lib/rules/oas3/array-parameter-serialization.js +4 -7
- package/lib/rules/oas3/array-parameter-serialization.js.map +1 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +2 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +1 -0
- package/lib/rules/oas3/boolean-parameter-prefixes.js +2 -5
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +1 -0
- package/lib/rules/oas3/component-name-unique.d.ts +2 -1
- package/lib/rules/oas3/component-name-unique.d.ts.map +1 -0
- package/lib/rules/oas3/component-name-unique.js +2 -5
- package/lib/rules/oas3/component-name-unique.js.map +1 -0
- package/lib/rules/oas3/index.d.ts +2 -1
- package/lib/rules/oas3/index.d.ts.map +1 -0
- package/lib/rules/oas3/index.js +130 -123
- package/lib/rules/oas3/index.js.map +1 -0
- package/lib/rules/oas3/no-empty-servers.d.ts +2 -1
- package/lib/rules/oas3/no-empty-servers.d.ts.map +1 -0
- package/lib/rules/oas3/no-empty-servers.js +2 -5
- package/lib/rules/oas3/no-empty-servers.js.map +1 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +2 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +1 -0
- package/lib/rules/oas3/no-example-value-and-externalValue.js +2 -5
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +1 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +2 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +1 -0
- package/lib/rules/oas3/no-invalid-media-type-examples.js +54 -34
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +1 -0
- package/lib/rules/oas3/no-server-example.com.d.ts +2 -1
- package/lib/rules/oas3/no-server-example.com.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-example.com.js +2 -5
- package/lib/rules/oas3/no-server-example.com.js.map +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +2 -1
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-trailing-slash.js +2 -5
- package/lib/rules/oas3/no-server-trailing-slash.js.map +1 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +2 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +1 -0
- package/lib/rules/oas3/no-server-variables-empty-enum.js +6 -14
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +1 -0
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +2 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +1 -0
- package/lib/rules/oas3/no-undefined-server-variable.js +3 -6
- package/lib/rules/oas3/no-undefined-server-variable.js.map +1 -0
- package/lib/rules/oas3/no-unused-components.d.ts +2 -1
- package/lib/rules/oas3/no-unused-components.d.ts.map +1 -0
- package/lib/rules/oas3/no-unused-components.js +16 -6
- package/lib/rules/oas3/no-unused-components.js.map +1 -0
- package/lib/rules/oas3/nullable-type-sibling.d.ts +3 -0
- package/lib/rules/oas3/nullable-type-sibling.d.ts.map +1 -0
- package/lib/rules/oas3/nullable-type-sibling.js +15 -0
- package/lib/rules/oas3/nullable-type-sibling.js.map +1 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +2 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +1 -0
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +6 -9
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +1 -0
- package/lib/rules/oas3/request-mime-type.d.ts +2 -1
- package/lib/rules/oas3/request-mime-type.d.ts.map +1 -0
- package/lib/rules/oas3/request-mime-type.js +6 -9
- package/lib/rules/oas3/request-mime-type.js.map +1 -0
- package/lib/rules/oas3/response-contains-property.d.ts +2 -1
- package/lib/rules/oas3/response-contains-property.d.ts.map +1 -0
- package/lib/rules/oas3/response-contains-property.js +5 -8
- package/lib/rules/oas3/response-contains-property.js.map +1 -0
- package/lib/rules/oas3/response-mime-type.d.ts +2 -1
- package/lib/rules/oas3/response-mime-type.d.ts.map +1 -0
- package/lib/rules/oas3/response-mime-type.js +6 -9
- package/lib/rules/oas3/response-mime-type.js.map +1 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +2 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +1 -0
- package/lib/rules/oas3/spec-components-invalid-map-name.js +2 -5
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +1 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.d.ts +3 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.d.ts.map +1 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.js +53 -0
- package/lib/rules/oas3/spec-discriminator-defaultMapping.js.map +1 -0
- package/lib/rules/oas3/spec-example-values.d.ts +3 -0
- package/lib/rules/oas3/spec-example-values.d.ts.map +1 -0
- package/lib/rules/oas3/spec-example-values.js +31 -0
- package/lib/rules/oas3/spec-example-values.js.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.d.ts +3 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.d.ts.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +16 -0
- package/lib/rules/oas3/spec-no-invalid-encoding-combinations.js.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.d.ts +3 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.d.ts.map +1 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.js +38 -0
- package/lib/rules/oas3/spec-no-invalid-tag-parents.js.map +1 -0
- package/lib/rules/oas3/spec-querystring-parameters.d.ts +3 -0
- package/lib/rules/oas3/spec-querystring-parameters.d.ts.map +1 -0
- package/lib/rules/oas3/spec-querystring-parameters.js +65 -0
- package/lib/rules/oas3/spec-querystring-parameters.js.map +1 -0
- package/lib/rules/openrpc/index.d.ts +4 -0
- package/lib/rules/openrpc/index.d.ts.map +1 -0
- package/lib/rules/openrpc/index.js +20 -0
- package/lib/rules/openrpc/index.js.map +1 -0
- package/lib/rules/openrpc/no-unused-components.d.ts +3 -0
- package/lib/rules/openrpc/no-unused-components.d.ts.map +1 -0
- package/lib/rules/openrpc/no-unused-components.js +82 -0
- package/lib/rules/openrpc/no-unused-components.js.map +1 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.d.ts +3 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.d.ts.map +1 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.js +28 -0
- package/lib/rules/openrpc/spec-no-duplicated-method-params.js.map +1 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.d.ts +3 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.d.ts.map +1 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.js +31 -0
- package/lib/rules/openrpc/spec-no-required-params-after-optional.js.map +1 -0
- package/lib/rules/other/stats.d.ts +74 -11
- package/lib/rules/other/stats.d.ts.map +1 -0
- package/lib/rules/other/stats.js +134 -19
- package/lib/rules/other/stats.js.map +1 -0
- package/lib/rules/overlay1/index.d.ts +2 -1
- package/lib/rules/overlay1/index.d.ts.map +1 -0
- package/lib/rules/overlay1/index.js +11 -11
- package/lib/rules/overlay1/index.js.map +1 -0
- package/lib/rules/respect/no-criteria-xpath.d.ts +2 -1
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +1 -0
- package/lib/rules/respect/no-criteria-xpath.js +5 -6
- package/lib/rules/respect/no-criteria-xpath.js.map +1 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.d.ts +3 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.d.ts.map +1 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +30 -0
- package/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts +3 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.d.ts.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
- package/lib/rules/respect/no-x-security-scheme-name-without-openapi.js.map +1 -0
- package/lib/rules/respect/respect-supported-versions.d.ts +2 -1
- package/lib/rules/respect/respect-supported-versions.d.ts.map +1 -0
- package/lib/rules/respect/respect-supported-versions.js +7 -10
- package/lib/rules/respect/respect-supported-versions.js.map +1 -0
- package/lib/rules/respect/x-security-scheme-name-reference.d.ts +3 -0
- package/lib/rules/respect/x-security-scheme-name-reference.d.ts.map +1 -0
- package/lib/rules/respect/x-security-scheme-name-reference.js +35 -0
- package/lib/rules/respect/x-security-scheme-name-reference.js.map +1 -0
- package/lib/rules/respect/x-security-scheme-required-values.d.ts +3 -0
- package/lib/rules/respect/x-security-scheme-required-values.d.ts.map +1 -0
- package/lib/rules/respect/x-security-scheme-required-values.js +60 -0
- package/lib/rules/respect/x-security-scheme-required-values.js.map +1 -0
- package/lib/rules/utils.d.ts +17 -5
- package/lib/rules/utils.d.ts.map +1 -0
- package/lib/rules/utils.js +45 -47
- package/lib/rules/utils.js.map +1 -0
- package/lib/types/arazzo.d.ts +2 -1
- package/lib/types/arazzo.d.ts.map +1 -0
- package/lib/types/arazzo.js +231 -62
- package/lib/types/arazzo.js.map +1 -0
- package/lib/types/asyncapi2.d.ts +2 -6
- package/lib/types/asyncapi2.d.ts.map +1 -0
- package/lib/types/asyncapi2.js +351 -202
- package/lib/types/asyncapi2.js.map +1 -0
- package/lib/types/asyncapi3.d.ts +2 -1
- package/lib/types/asyncapi3.d.ts.map +1 -0
- package/lib/types/asyncapi3.js +255 -91
- package/lib/types/asyncapi3.js.map +1 -0
- package/lib/types/entity.d.ts +9 -0
- package/lib/types/entity.d.ts.map +1 -0
- package/lib/types/entity.js +32 -0
- package/lib/types/entity.js.map +1 -0
- package/lib/types/index.d.ts +24 -3
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +13 -19
- package/lib/types/index.js.map +1 -0
- package/lib/types/json-schema-adapter.d.ts +11 -2
- package/lib/types/json-schema-adapter.d.ts.map +1 -0
- package/lib/types/json-schema-adapter.js +48 -26
- package/lib/types/json-schema-adapter.js.map +1 -0
- package/lib/types/json-schema-draft7.shared.d.ts +7 -0
- package/lib/types/json-schema-draft7.shared.d.ts.map +1 -0
- package/lib/types/json-schema-draft7.shared.js +101 -0
- package/lib/types/json-schema-draft7.shared.js.map +1 -0
- package/lib/types/oas2.d.ts +107 -3
- package/lib/types/oas2.d.ts.map +1 -0
- package/lib/types/oas2.js +19 -20
- package/lib/types/oas2.js.map +1 -0
- package/lib/types/oas3.d.ts +198 -7
- package/lib/types/oas3.d.ts.map +1 -0
- package/lib/types/oas3.js +377 -103
- package/lib/types/oas3.js.map +1 -0
- package/lib/types/oas3_1.d.ts +207 -6
- package/lib/types/oas3_1.d.ts.map +1 -0
- package/lib/types/oas3_1.js +56 -49
- package/lib/types/oas3_1.js.map +1 -0
- package/lib/types/oas3_2.d.ts +215 -0
- package/lib/types/oas3_2.d.ts.map +1 -0
- package/lib/types/oas3_2.js +312 -0
- package/lib/types/oas3_2.js.map +1 -0
- package/lib/types/openrpc.d.ts +136 -0
- package/lib/types/openrpc.d.ts.map +1 -0
- package/lib/types/openrpc.js +360 -0
- package/lib/types/openrpc.js.map +1 -0
- package/lib/types/overlay.d.ts +2 -1
- package/lib/types/overlay.d.ts.map +1 -0
- package/lib/types/overlay.js +35 -13
- package/lib/types/overlay.js.map +1 -0
- package/lib/types/redocly-yaml.d.ts +25 -21
- package/lib/types/redocly-yaml.d.ts.map +1 -0
- package/lib/types/redocly-yaml.js +399 -851
- package/lib/types/redocly-yaml.js.map +1 -0
- package/lib/typings/arazzo.d.ts +45 -4
- package/lib/typings/arazzo.d.ts.map +1 -0
- package/lib/typings/arazzo.js +3 -5
- package/lib/typings/arazzo.js.map +1 -0
- package/lib/typings/asyncapi.d.ts +8 -0
- package/lib/typings/asyncapi.d.ts.map +1 -0
- package/lib/typings/asyncapi.js +2 -2
- package/lib/typings/asyncapi.js.map +1 -0
- package/lib/typings/asyncapi3.d.ts +1 -0
- package/lib/typings/asyncapi3.d.ts.map +1 -0
- package/lib/typings/asyncapi3.js +2 -2
- package/lib/typings/asyncapi3.js.map +1 -0
- package/lib/typings/common.d.ts +7 -2
- package/lib/typings/common.d.ts.map +1 -0
- package/lib/typings/common.js +2 -2
- package/lib/typings/common.js.map +1 -0
- package/lib/typings/openapi.d.ts +87 -30
- package/lib/typings/openapi.d.ts.map +1 -0
- package/lib/typings/openapi.js +2 -2
- package/lib/typings/openapi.js.map +1 -0
- package/lib/typings/openrpc.d.ts +110 -0
- package/lib/typings/openrpc.d.ts.map +1 -0
- package/lib/typings/openrpc.js +2 -0
- package/lib/typings/openrpc.js.map +1 -0
- package/lib/typings/overlay.d.ts +1 -0
- package/lib/typings/overlay.d.ts.map +1 -0
- package/lib/typings/overlay.js +2 -4
- package/lib/typings/overlay.js.map +1 -0
- package/lib/typings/swagger.d.ts +3 -2
- package/lib/typings/swagger.d.ts.map +1 -0
- package/lib/typings/swagger.js +2 -2
- package/lib/typings/swagger.js.map +1 -0
- package/lib/utils/assign-config.d.ts +7 -0
- package/lib/utils/assign-config.d.ts.map +1 -0
- package/lib/utils/assign-config.js +28 -0
- package/lib/utils/assign-config.js.map +1 -0
- package/lib/utils/dequal.d.ts +6 -0
- package/lib/utils/dequal.d.ts.map +1 -0
- package/lib/utils/dequal.js +37 -0
- package/lib/utils/dequal.js.map +1 -0
- package/lib/utils/does-yaml-file-exist.d.ts +2 -0
- package/lib/utils/does-yaml-file-exist.d.ts.map +1 -0
- package/lib/utils/does-yaml-file-exist.js +7 -0
- package/lib/utils/does-yaml-file-exist.js.map +1 -0
- package/lib/utils/error.d.ts +3 -0
- package/lib/utils/error.d.ts.map +1 -0
- package/lib/utils/error.js +3 -0
- package/lib/utils/error.js.map +1 -0
- package/lib/utils/get-intersection-length.d.ts +2 -0
- package/lib/utils/get-intersection-length.d.ts.map +1 -0
- package/lib/utils/get-intersection-length.js +11 -0
- package/lib/utils/get-intersection-length.js.map +1 -0
- package/lib/utils/get-matching-status-code-range.d.ts +2 -0
- package/lib/utils/get-matching-status-code-range.d.ts.map +1 -0
- package/lib/utils/get-matching-status-code-range.js +4 -0
- package/lib/utils/get-matching-status-code-range.js.map +1 -0
- package/lib/utils/get-own.d.ts +2 -0
- package/lib/utils/get-own.d.ts.map +1 -0
- package/lib/utils/get-own.js +4 -0
- package/lib/utils/get-own.js.map +1 -0
- package/lib/utils/identity.d.ts +2 -0
- package/lib/utils/identity.d.ts.map +1 -0
- package/lib/utils/identity.js +4 -0
- package/lib/utils/identity.js.map +1 -0
- package/lib/utils/is-custom-rule-id.d.ts +2 -0
- package/lib/utils/is-custom-rule-id.d.ts.map +1 -0
- package/lib/utils/is-custom-rule-id.js +4 -0
- package/lib/utils/is-custom-rule-id.js.map +1 -0
- package/lib/utils/is-defined.d.ts +2 -0
- package/lib/utils/is-defined.d.ts.map +1 -0
- package/lib/utils/is-defined.js +4 -0
- package/lib/utils/is-defined.js.map +1 -0
- package/lib/utils/is-empty-array.d.ts +2 -0
- package/lib/utils/is-empty-array.d.ts.map +1 -0
- package/lib/utils/is-empty-array.js +4 -0
- package/lib/utils/is-empty-array.js.map +1 -0
- package/lib/utils/is-empty-object.d.ts +2 -0
- package/lib/utils/is-empty-object.d.ts.map +1 -0
- package/lib/utils/is-empty-object.js +5 -0
- package/lib/utils/is-empty-object.js.map +1 -0
- package/lib/utils/is-not-empty-array.d.ts +2 -0
- package/lib/utils/is-not-empty-array.d.ts.map +1 -0
- package/lib/utils/is-not-empty-array.js +4 -0
- package/lib/utils/is-not-empty-array.js.map +1 -0
- package/lib/utils/is-not-empty-object.d.ts +2 -0
- package/lib/utils/is-not-empty-object.d.ts.map +1 -0
- package/lib/utils/is-not-empty-object.js +6 -0
- package/lib/utils/is-not-empty-object.js.map +1 -0
- package/lib/utils/is-not-string.d.ts +2 -0
- package/lib/utils/is-not-string.d.ts.map +1 -0
- package/lib/utils/is-not-string.js +5 -0
- package/lib/utils/is-not-string.js.map +1 -0
- package/lib/utils/is-ordered.d.ts +7 -0
- package/lib/utils/is-ordered.d.ts.map +1 -0
- package/lib/utils/is-ordered.js +27 -0
- package/lib/utils/is-ordered.js.map +1 -0
- package/lib/utils/is-path-parameter.d.ts +2 -0
- package/lib/utils/is-path-parameter.d.ts.map +1 -0
- package/lib/utils/is-path-parameter.js +4 -0
- package/lib/utils/is-path-parameter.js.map +1 -0
- package/lib/utils/is-plain-object.d.ts +2 -0
- package/lib/utils/is-plain-object.d.ts.map +1 -0
- package/lib/utils/is-plain-object.js +5 -0
- package/lib/utils/is-plain-object.js.map +1 -0
- package/lib/utils/is-string.d.ts +2 -0
- package/lib/utils/is-string.d.ts.map +1 -0
- package/lib/utils/is-string.js +4 -0
- package/lib/utils/is-string.js.map +1 -0
- package/lib/utils/is-truthy.d.ts +3 -0
- package/lib/utils/is-truthy.d.ts.map +1 -0
- package/lib/utils/is-truthy.js +4 -0
- package/lib/utils/is-truthy.js.map +1 -0
- package/lib/utils/keys-of.d.ts +2 -0
- package/lib/utils/keys-of.d.ts.map +1 -0
- package/lib/utils/keys-of.js +6 -0
- package/lib/utils/keys-of.js.map +1 -0
- package/lib/utils/make-ref-id.d.ts +2 -0
- package/lib/utils/make-ref-id.d.ts.map +1 -0
- package/lib/utils/make-ref-id.js +4 -0
- package/lib/utils/make-ref-id.js.map +1 -0
- package/lib/utils/next-tick.d.ts +2 -0
- package/lib/utils/next-tick.d.ts.map +1 -0
- package/lib/utils/next-tick.js +6 -0
- package/lib/utils/next-tick.js.map +1 -0
- package/lib/utils/oas-has-component.d.ts +3 -0
- package/lib/utils/oas-has-component.d.ts.map +1 -0
- package/lib/utils/oas-has-component.js +4 -0
- package/lib/utils/oas-has-component.js.map +1 -0
- package/lib/utils/omit.d.ts +2 -0
- package/lib/utils/omit.d.ts.map +1 -0
- package/lib/utils/omit.js +8 -0
- package/lib/utils/omit.js.map +1 -0
- package/lib/utils/pause.d.ts +2 -0
- package/lib/utils/pause.d.ts.map +1 -0
- package/lib/utils/pause.js +4 -0
- package/lib/utils/pause.js.map +1 -0
- package/lib/utils/pluralize.d.ts +2 -0
- package/lib/utils/pluralize.d.ts.map +1 -0
- package/lib/utils/pluralize.js +8 -0
- package/lib/utils/pluralize.js.map +1 -0
- package/lib/utils/read-file-from-url.d.ts +6 -0
- package/lib/utils/read-file-from-url.d.ts.map +1 -0
- package/lib/utils/read-file-from-url.js +26 -0
- package/lib/utils/read-file-from-url.js.map +1 -0
- package/lib/utils/regex-from-string.d.ts +2 -0
- package/lib/utils/regex-from-string.d.ts.map +1 -0
- package/lib/utils/regex-from-string.js +5 -0
- package/lib/utils/regex-from-string.js.map +1 -0
- package/lib/utils/scorecards.d.ts +13 -0
- package/lib/utils/scorecards.d.ts.map +1 -0
- package/lib/utils/scorecards.js +99 -0
- package/lib/utils/scorecards.js.map +1 -0
- package/lib/utils/slash.d.ts +5 -0
- package/lib/utils/slash.d.ts.map +1 -0
- package/lib/utils/slash.js +11 -0
- package/lib/utils/slash.js.map +1 -0
- package/lib/utils/split-camel-case-into-words.d.ts +2 -0
- package/lib/utils/split-camel-case-into-words.d.ts.map +1 -0
- package/lib/utils/split-camel-case-into-words.js +13 -0
- package/lib/utils/split-camel-case-into-words.js.map +1 -0
- package/lib/utils/stack.d.ts +12 -0
- package/lib/utils/stack.d.ts.map +1 -0
- package/lib/utils/stack.js +7 -0
- package/lib/utils/stack.js.map +1 -0
- package/lib/utils/types.d.ts +5 -0
- package/lib/utils/types.d.ts.map +1 -0
- package/lib/utils/types.js +2 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils/validate-mime-type.d.ts +4 -0
- package/lib/utils/validate-mime-type.d.ts.map +1 -0
- package/lib/utils/validate-mime-type.js +31 -0
- package/lib/utils/validate-mime-type.js.map +1 -0
- package/lib/utils/yaml-fs-helper.d.ts +6 -0
- package/lib/utils/yaml-fs-helper.d.ts.map +1 -0
- package/lib/utils/yaml-fs-helper.js +23 -0
- package/lib/utils/yaml-fs-helper.js.map +1 -0
- package/lib/visitors.d.ts +69 -27
- package/lib/visitors.d.ts.map +1 -0
- package/lib/visitors.js +10 -9
- package/lib/visitors.js.map +1 -0
- package/lib/walk.d.ts +15 -10
- package/lib/walk.d.ts.map +1 -0
- package/lib/walk.js +69 -44
- package/lib/walk.js.map +1 -0
- package/package.json +34 -16
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +0 -38
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +0 -44
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +0 -25
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +0 -37
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +0 -4
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +0 -36
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts +0 -3
- package/lib/benchmark/benches/recommended-oas3.bench.js +0 -21
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +0 -3
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +0 -22
- package/lib/benchmark/utils.d.ts +0 -6
- package/lib/benchmark/utils.js +0 -34
- package/lib/bundle.d.ts +0 -50
- package/lib/bundle.js +0 -389
- package/lib/decorators/common/media-type-examples-override.d.ts +0 -2
- package/lib/decorators/common/registry-dependencies.d.ts +0 -2
- package/lib/decorators/common/registry-dependencies.js +0 -24
- package/lib/output.d.ts +0 -3
- package/lib/output.js +0 -9
- package/lib/redocly/domains.d.ts +0 -14
- package/lib/redocly/domains.js +0 -41
- package/lib/redocly/index.d.ts +0 -30
- package/lib/redocly/index.js +0 -131
- package/lib/redocly/redocly-client-types.d.ts +0 -8
- package/lib/redocly/redocly-client-types.js +0 -2
- package/lib/redocly/registry-api-types.d.ts +0 -29
- package/lib/redocly/registry-api-types.js +0 -2
- package/lib/redocly/registry-api.d.ts +0 -17
- package/lib/redocly/registry-api.js +0 -100
- package/lib/rules/common/info-license-url.d.ts +0 -2
- package/lib/rules/common/info-license-url.js +0 -12
- package/lib/rules/common/path-excludes-patterns.d.ts +0 -2
- package/lib/rules/common/path-excludes-patterns.js +0 -22
- package/lib/rules/no-unresolved-refs.d.ts +0 -5
- package/lib/utils.d.ts +0 -70
- package/lib/utils.js +0 -300
package/README.md
CHANGED
|
@@ -137,6 +137,17 @@ const bundleResults = await bundleFromString({
|
|
|
137
137
|
});
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
### Load and lint a configuration file
|
|
141
|
+
|
|
142
|
+
[Lint](https://redocly.com/docs/cli/commands/lint/) a configuration file to validate its structure and rules.
|
|
143
|
+
|
|
144
|
+
```js
|
|
145
|
+
import { lintConfig, loadConfig } from '@redocly/openapi-core';
|
|
146
|
+
|
|
147
|
+
const config = await loadConfig({ configPath: 'redocly.yaml' });
|
|
148
|
+
const configProblems = await lintConfig({ config });
|
|
149
|
+
```
|
|
150
|
+
|
|
140
151
|
## API
|
|
141
152
|
|
|
142
153
|
### `createConfig`
|
|
@@ -164,11 +175,28 @@ it tries to find `redocly.yaml` in the current working directory.
|
|
|
164
175
|
async function loadConfig(options?: {
|
|
165
176
|
// optional path to the config file for resolving $refs and proper error locations
|
|
166
177
|
configPath?: string;
|
|
167
|
-
// allows to add custom `extends`
|
|
178
|
+
// allows to add custom `extends` instead of the one from the config file
|
|
168
179
|
customExtends?: string[];
|
|
169
180
|
}): Promise<Config>;
|
|
170
181
|
```
|
|
171
182
|
|
|
183
|
+
### `lintConfig`
|
|
184
|
+
|
|
185
|
+
Lint a configuration file to validate its structure and rules.
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
async function lintConfig(options: {
|
|
189
|
+
// config object to validate
|
|
190
|
+
config: Config;
|
|
191
|
+
// optional severity level for validation
|
|
192
|
+
severity?: ProblemSeverity;
|
|
193
|
+
// optional external reference resolver
|
|
194
|
+
externalRefResolver?: BaseResolver;
|
|
195
|
+
// optional override for config types
|
|
196
|
+
externalConfigTypes?: Record<string, NodeType>;
|
|
197
|
+
}): Promise<NormalizedProblem[]>;
|
|
198
|
+
```
|
|
199
|
+
|
|
172
200
|
### `lint`
|
|
173
201
|
|
|
174
202
|
Lint an OpenAPI document from the file system.
|
|
@@ -179,6 +207,8 @@ async function lint(options: {
|
|
|
179
207
|
ref: string;
|
|
180
208
|
// config object
|
|
181
209
|
config: Config;
|
|
210
|
+
// optional external reference resolver
|
|
211
|
+
externalRefResolver?: BaseResolver;
|
|
182
212
|
}): Promise<NormalizedProblem[]>;
|
|
183
213
|
```
|
|
184
214
|
|
|
@@ -194,6 +224,8 @@ async function lintFromString(options: {
|
|
|
194
224
|
absoluteRef?: string;
|
|
195
225
|
// config object
|
|
196
226
|
config: Config;
|
|
227
|
+
// optional external reference resolver
|
|
228
|
+
externalRefResolver?: BaseResolver;
|
|
197
229
|
}): Promise<NormalizedProblem[]>;
|
|
198
230
|
```
|
|
199
231
|
|
|
@@ -204,7 +236,9 @@ Bundle an OpenAPI document from the file system.
|
|
|
204
236
|
```ts
|
|
205
237
|
async function bundle(options: {
|
|
206
238
|
// path to the OpenAPI document root
|
|
207
|
-
ref
|
|
239
|
+
ref?: string;
|
|
240
|
+
// optional document object (alternative to ref)
|
|
241
|
+
doc?: Document;
|
|
208
242
|
// config object
|
|
209
243
|
config: Config;
|
|
210
244
|
// whether to fully dereference $refs, resulting document won't have any $ref
|
|
@@ -214,6 +248,10 @@ async function bundle(options: {
|
|
|
214
248
|
removeUnusedComponents?: boolean;
|
|
215
249
|
// whether to keep $ref pointers to the http URLs and resolve only local fs $refs
|
|
216
250
|
keepUrlRefs?: boolean;
|
|
251
|
+
// optional external reference resolver
|
|
252
|
+
externalRefResolver?: BaseResolver;
|
|
253
|
+
// optional base path for resolution
|
|
254
|
+
base?: string | null;
|
|
217
255
|
}): Promise<{
|
|
218
256
|
bundle: {
|
|
219
257
|
parsed: object; // OpenAPI document object as js object
|
|
@@ -223,7 +261,6 @@ async function bundle(options: {
|
|
|
223
261
|
rootType
|
|
224
262
|
refTypes
|
|
225
263
|
visitorsData
|
|
226
|
-
|
|
227
264
|
}>;
|
|
228
265
|
```
|
|
229
266
|
|
|
@@ -246,6 +283,8 @@ async function bundleFromString(options: {
|
|
|
246
283
|
removeUnusedComponents?: boolean;
|
|
247
284
|
// whether to keep $ref pointers to the http URLs and resolve only local fs $refs
|
|
248
285
|
keepUrlRefs?: boolean;
|
|
286
|
+
// optional external reference resolver
|
|
287
|
+
externalRefResolver?: BaseResolver;
|
|
249
288
|
}): Promise<{
|
|
250
289
|
bundle: {
|
|
251
290
|
parsed: object; // OpenAPI document object as js object
|
|
@@ -255,7 +294,6 @@ async function bundleFromString(options: {
|
|
|
255
294
|
rootType
|
|
256
295
|
refTypes
|
|
257
296
|
visitorsData
|
|
258
|
-
|
|
259
297
|
}>;
|
|
260
298
|
```
|
|
261
299
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Config } from '../config/config.js';
|
|
2
|
+
import { type RuleSeverity } from '../config/types.js';
|
|
3
|
+
import { type Document, type BaseResolver } from '../resolve.js';
|
|
4
|
+
import { type NormalizedNodeType, type NodeType } from '../types/index.js';
|
|
5
|
+
import { type NormalizedProblem } from '../walk.js';
|
|
6
|
+
export type CoreBundleOptions = {
|
|
7
|
+
externalRefResolver?: BaseResolver;
|
|
8
|
+
config: Config;
|
|
9
|
+
dereference?: boolean;
|
|
10
|
+
base?: string | null;
|
|
11
|
+
removeUnusedComponents?: boolean;
|
|
12
|
+
keepUrlRefs?: boolean;
|
|
13
|
+
componentRenamingConflicts?: RuleSeverity;
|
|
14
|
+
};
|
|
15
|
+
export type BundleResult = {
|
|
16
|
+
bundle: Document;
|
|
17
|
+
problems: NormalizedProblem[];
|
|
18
|
+
fileDependencies: Set<string>;
|
|
19
|
+
rootType: NormalizedNodeType;
|
|
20
|
+
refTypes?: Map<string, NormalizedNodeType>;
|
|
21
|
+
visitorsData: Record<string, Record<string, unknown>>;
|
|
22
|
+
};
|
|
23
|
+
export declare function bundleDocument(opts: {
|
|
24
|
+
document: Document;
|
|
25
|
+
config: Config;
|
|
26
|
+
types: Record<string, NodeType>;
|
|
27
|
+
externalRefResolver: BaseResolver;
|
|
28
|
+
dereference?: boolean;
|
|
29
|
+
removeUnusedComponents?: boolean;
|
|
30
|
+
keepUrlRefs?: boolean;
|
|
31
|
+
componentRenamingConflicts?: RuleSeverity;
|
|
32
|
+
}): Promise<BundleResult>;
|
|
33
|
+
//# sourceMappingURL=bundle-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-document.d.ts","sourceRoot":"","sources":["../../src/bundle/bundle-document.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,OAAO,EAAmB,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAkB,KAAK,kBAAkB,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE3F,OAAO,EAAkC,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B,CAAC,EAAE,YAAY,CAAC;CAC3C,CAAC;AAIF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD,CAAC;AAEF,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAChC,mBAAmB,EAAE,YAAY,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B,CAAC,EAAE,YAAY,CAAC;CAC3C,GAAG,OAAO,CAAC,YAAY,CAAC,CAoHxB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { makeBundleVisitor } from '../bundle/bundle-visitor.js';
|
|
2
|
+
import { initRules } from '../config/rules.js';
|
|
3
|
+
import { RemoveUnusedComponents as RemoveUnusedComponentsOas2 } from '../decorators/oas2/remove-unused-components.js';
|
|
4
|
+
import { RemoveUnusedComponents as RemoveUnusedComponentsOas3 } from '../decorators/oas3/remove-unused-components.js';
|
|
5
|
+
import { detectSpec, getMajorSpecVersion } from '../detect-spec.js';
|
|
6
|
+
import { resolveDocument } from '../resolve.js';
|
|
7
|
+
import { normalizeTypes } from '../types/index.js';
|
|
8
|
+
import { normalizeVisitors } from '../visitors.js';
|
|
9
|
+
import { walkDocument } from '../walk.js';
|
|
10
|
+
export async function bundleDocument(opts) {
|
|
11
|
+
const { document, config, types, externalRefResolver, dereference = false, removeUnusedComponents = false, keepUrlRefs = false, componentRenamingConflicts, } = opts;
|
|
12
|
+
const specVersion = detectSpec(document.parsed);
|
|
13
|
+
const specMajorVersion = getMajorSpecVersion(specVersion);
|
|
14
|
+
const rules = config.getRulesForSpecVersion(specMajorVersion);
|
|
15
|
+
const normalizedTypes = normalizeTypes(config.extendTypes(types, specVersion), config);
|
|
16
|
+
const preprocessors = initRules(rules, config, 'preprocessors', specVersion);
|
|
17
|
+
const decorators = initRules(rules, config, 'decorators', specVersion);
|
|
18
|
+
const ctx = {
|
|
19
|
+
problems: [],
|
|
20
|
+
specVersion,
|
|
21
|
+
config,
|
|
22
|
+
refTypes: new Map(),
|
|
23
|
+
visitorsData: {},
|
|
24
|
+
};
|
|
25
|
+
let resolvedRefMap = await resolveDocument({
|
|
26
|
+
rootDocument: document,
|
|
27
|
+
rootType: normalizedTypes.Root,
|
|
28
|
+
externalRefResolver,
|
|
29
|
+
});
|
|
30
|
+
if (preprocessors.length > 0) {
|
|
31
|
+
// Make additional pass to resolve refs defined in preprocessors.
|
|
32
|
+
walkDocument({
|
|
33
|
+
document,
|
|
34
|
+
rootType: normalizedTypes.Root,
|
|
35
|
+
normalizedVisitors: normalizeVisitors(preprocessors, normalizedTypes),
|
|
36
|
+
resolvedRefMap,
|
|
37
|
+
ctx,
|
|
38
|
+
});
|
|
39
|
+
resolvedRefMap = await resolveDocument({
|
|
40
|
+
rootDocument: document,
|
|
41
|
+
rootType: normalizedTypes.Root,
|
|
42
|
+
externalRefResolver,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const bundleVisitor = normalizeVisitors([
|
|
46
|
+
{
|
|
47
|
+
severity: 'error',
|
|
48
|
+
ruleId: 'bundler',
|
|
49
|
+
visitor: makeBundleVisitor({
|
|
50
|
+
version: specMajorVersion,
|
|
51
|
+
dereference,
|
|
52
|
+
rootDocument: document,
|
|
53
|
+
resolvedRefMap,
|
|
54
|
+
keepUrlRefs,
|
|
55
|
+
componentRenamingConflicts,
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
...decorators.filter((decorator) => decorator.ruleId !== 'remove-unused-components'),
|
|
59
|
+
], normalizedTypes);
|
|
60
|
+
walkDocument({
|
|
61
|
+
document,
|
|
62
|
+
rootType: normalizedTypes.Root,
|
|
63
|
+
normalizedVisitors: bundleVisitor,
|
|
64
|
+
resolvedRefMap,
|
|
65
|
+
ctx,
|
|
66
|
+
});
|
|
67
|
+
if (removeUnusedComponents ||
|
|
68
|
+
config.getDecoratorSettings('remove-unused-components', specVersion).severity !== 'off') {
|
|
69
|
+
const postBundleRefMap = await resolveDocument({
|
|
70
|
+
rootDocument: document,
|
|
71
|
+
rootType: normalizedTypes.Root,
|
|
72
|
+
externalRefResolver,
|
|
73
|
+
});
|
|
74
|
+
const postBundleVisitors = normalizeVisitors([
|
|
75
|
+
{
|
|
76
|
+
severity: 'error',
|
|
77
|
+
ruleId: 'remove-unused-components',
|
|
78
|
+
visitor: specMajorVersion === 'oas2'
|
|
79
|
+
? RemoveUnusedComponentsOas2({})
|
|
80
|
+
: RemoveUnusedComponentsOas3({}),
|
|
81
|
+
},
|
|
82
|
+
], normalizedTypes);
|
|
83
|
+
walkDocument({
|
|
84
|
+
document,
|
|
85
|
+
rootType: normalizedTypes.Root,
|
|
86
|
+
normalizedVisitors: postBundleVisitors,
|
|
87
|
+
resolvedRefMap: postBundleRefMap,
|
|
88
|
+
ctx,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
bundle: document,
|
|
93
|
+
problems: ctx.problems.map((problem) => config.addProblemToIgnore(problem)),
|
|
94
|
+
fileDependencies: externalRefResolver.getFiles(),
|
|
95
|
+
rootType: normalizedTypes.Root,
|
|
96
|
+
refTypes: ctx.refTypes,
|
|
97
|
+
visitorsData: ctx.visitorsData,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=bundle-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-document.js","sourceRoot":"","sources":["../../src/bundle/bundle-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAoC,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,cAAc,EAA0C,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAA4C,MAAM,YAAY,CAAC;AAuBpF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IASpC;IACC,MAAM,EACJ,QAAQ,EACR,MAAM,EACN,KAAK,EACL,mBAAmB,EACnB,WAAW,GAAG,KAAK,EACnB,sBAAsB,GAAG,KAAK,EAC9B,WAAW,GAAG,KAAK,EACnB,0BAA0B,GAC3B,GAAG,IAAI,CAAC;IACT,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC1D,MAAM,KAAK,G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B,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,YAAY,EAAE,GAAG,CAAC,YAAY;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Config } from '../config/config.js';
|
|
2
|
+
import { BaseResolver, type Document } from '../resolve.js';
|
|
3
|
+
import { type CoreBundleOptions } from './bundle-document.js';
|
|
4
|
+
export { Source, Document } from '../resolve.js';
|
|
5
|
+
export declare function bundleOas(opts: {
|
|
6
|
+
ref?: string;
|
|
7
|
+
doc?: Document;
|
|
8
|
+
} & CoreBundleOptions): Promise<import("./bundle-document.js").BundleResult>;
|
|
9
|
+
export declare function createEmptyRedoclyConfig(options?: {
|
|
10
|
+
configPath?: string;
|
|
11
|
+
customExtends?: string[];
|
|
12
|
+
externalRefResolver?: BaseResolver;
|
|
13
|
+
}): Config;
|
|
14
|
+
//# sourceMappingURL=bundle-oas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-oas.d.ts","sourceRoot":"","sources":["../../src/bundle/bundle-oas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,EAAE,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM5D,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEjD,wBAAsB,SAAS,CAC7B,IAAI,EAAE;IACJ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,QAAQ,CAAC;CAChB,GAAG,iBAAiB,wDA6CtB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,YAAY,CAAC;CAC/B,UAaP"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Config } from '../config/config.js';
|
|
2
|
+
import { detectSpec } from '../detect-spec.js';
|
|
3
|
+
// Specialized OAS only bundle export for vite bundle
|
|
4
|
+
import { BaseResolver } from '../resolve.js';
|
|
5
|
+
import { Oas2Types } from '../types/oas2.js';
|
|
6
|
+
import { Oas3Types } from '../types/oas3.js';
|
|
7
|
+
import { Oas3_1Types } from '../types/oas3_1.js';
|
|
8
|
+
import { Oas3_2Types } from '../types/oas3_2.js';
|
|
9
|
+
import { bundleDocument } from './bundle-document.js';
|
|
10
|
+
export { Source } from '../resolve.js';
|
|
11
|
+
export async function bundleOas(opts) {
|
|
12
|
+
const { ref, doc, externalRefResolver = new BaseResolver(opts.config.resolve), base = null, } = opts;
|
|
13
|
+
if (!(ref || doc)) {
|
|
14
|
+
throw new Error('Document or reference is required.\n');
|
|
15
|
+
}
|
|
16
|
+
const document = doc === undefined ? await externalRefResolver.resolveDocument(base, ref, true) : doc;
|
|
17
|
+
if (document instanceof Error) {
|
|
18
|
+
throw document;
|
|
19
|
+
}
|
|
20
|
+
const version = detectSpec(document.parsed);
|
|
21
|
+
let types;
|
|
22
|
+
switch (version) {
|
|
23
|
+
case 'oas2':
|
|
24
|
+
types = Oas2Types;
|
|
25
|
+
break;
|
|
26
|
+
case 'oas3_0':
|
|
27
|
+
types = Oas3Types;
|
|
28
|
+
break;
|
|
29
|
+
case 'oas3_1':
|
|
30
|
+
types = Oas3_1Types;
|
|
31
|
+
break;
|
|
32
|
+
case 'oas3_2':
|
|
33
|
+
types = Oas3_2Types;
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
throw new Error(`Unsupported OpenAPI version: ${version}`);
|
|
37
|
+
}
|
|
38
|
+
return bundleDocument({
|
|
39
|
+
document,
|
|
40
|
+
...opts,
|
|
41
|
+
externalRefResolver,
|
|
42
|
+
types,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export function createEmptyRedoclyConfig(options = {}) {
|
|
46
|
+
return new Config({
|
|
47
|
+
rules: {},
|
|
48
|
+
preprocessors: {},
|
|
49
|
+
decorators: {},
|
|
50
|
+
plugins: [],
|
|
51
|
+
}, {
|
|
52
|
+
configPath: options.configPath,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=bundle-oas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-oas.js","sourceRoot":"","sources":["../../src/bundle/bundle-oas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,qDAAqD;AACrD,OAAO,EAAE,YAAY,EAAiB,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAA0B,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,IAGqB;IAErB,MAAM,EACJ,GAAG,EACH,GAAG,EACH,mBAAmB,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAC3D,IAAI,GAAG,IAAI,GACZ,GAAG,IAAI,CAAC;IACT,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,QAAQ,GACZ,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,mBAAmB,CAAC,eAAe,CAAC,IAAI,EAAE,GAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAExF,IAAI,QAAQ,YAAY,KAAK,EAAE,CAAC;QAC9B,MAAM,QAAQ,CAAC;IACjB,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE5C,IAAI,KAA+B,CAAC;IACpC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM;YACT,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,QAAQ;YACX,KAAK,GAAG,SAAS,CAAC;YAClB,MAAM;QACR,KAAK,QAAQ;YACX,KAAK,GAAG,WAAW,CAAC;YACpB,MAAM;QACR,KAAK,QAAQ;YACX,KAAK,GAAG,WAAW,CAAC;YACpB,MAAM;QACR;YACE,MAAM,IAAI,KAAK,CAAC,gCAAgC,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,cAAc,CAAC;QACpB,QAAQ;QACR,GAAG,IAAI;QACP,mBAAmB;QACnB,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,UAII,EAAE;IAEN,OAAO,IAAI,MAAM,CACf;QACE,KAAK,EAAE,EAAE;QACT,aAAa,EAAE,EAAE;QACjB,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,EAAE;KACZ,EACD;QACE,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RuleSeverity } from '../config/types.js';
|
|
2
|
+
import { type SpecMajorVersion } from '../oas-types.js';
|
|
3
|
+
import { type ResolvedRefMap, type Document } from '../resolve.js';
|
|
4
|
+
import { type Oas3Visitor, type Oas2Visitor } from '../visitors.js';
|
|
5
|
+
export declare function mapTypeToComponent(typeName: string, version: SpecMajorVersion): "definitions" | "examples" | "parameters" | "responses" | "schemas" | "requestBodies" | "headers" | "mediaTypes" | "tags" | "securitySchemes" | "links" | "callbacks" | "contentDescriptors" | "errors" | "examplePairingObjects" | null;
|
|
6
|
+
export declare function makeBundleVisitor({ version, dereference, rootDocument, resolvedRefMap, keepUrlRefs, componentRenamingConflicts, }: {
|
|
7
|
+
version: SpecMajorVersion;
|
|
8
|
+
dereference: boolean;
|
|
9
|
+
rootDocument: Document;
|
|
10
|
+
resolvedRefMap: ResolvedRefMap;
|
|
11
|
+
keepUrlRefs: boolean;
|
|
12
|
+
componentRenamingConflicts?: RuleSeverity;
|
|
13
|
+
}): Oas3Visitor | Oas2Visitor;
|
|
14
|
+
//# sourceMappingURL=bundle-visitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-visitor.d.ts","sourceRoot":"","sources":["../../src/bundle/bundle-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAWxD,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAKnE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGpE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,4OAyF7E;AAED,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,EACd,WAAW,EACX,0BAAmC,GACpC,EAAE;IACD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,QAAQ,CAAC;IACvB,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,0BAA0B,CAAC,EAAE,YAAY,CAAC;CAC3C,6BAoMA"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { isAbsoluteUrl, replaceRef, isExternalValue, isRef, pointerBaseName, refBaseName, isMappingRef, } from '../ref-utils.js';
|
|
2
|
+
import { reportUnresolvedRef } from '../rules/common/no-unresolved-refs.js';
|
|
3
|
+
import { dequal } from '../utils/dequal.js';
|
|
4
|
+
import { makeRefId } from '../utils/make-ref-id.js';
|
|
5
|
+
export function mapTypeToComponent(typeName, version) {
|
|
6
|
+
switch (version) {
|
|
7
|
+
case 'oas3':
|
|
8
|
+
switch (typeName) {
|
|
9
|
+
case 'Schema':
|
|
10
|
+
return 'schemas';
|
|
11
|
+
case 'Parameter':
|
|
12
|
+
return 'parameters';
|
|
13
|
+
case 'Response':
|
|
14
|
+
return 'responses';
|
|
15
|
+
case 'Example':
|
|
16
|
+
return 'examples';
|
|
17
|
+
case 'RequestBody':
|
|
18
|
+
return 'requestBodies';
|
|
19
|
+
case 'Header':
|
|
20
|
+
return 'headers';
|
|
21
|
+
case 'SecuritySchema':
|
|
22
|
+
return 'securitySchemes';
|
|
23
|
+
case 'Link':
|
|
24
|
+
return 'links';
|
|
25
|
+
case 'Callback':
|
|
26
|
+
return 'callbacks';
|
|
27
|
+
case 'MediaTypesMap':
|
|
28
|
+
return 'mediaTypes';
|
|
29
|
+
default:
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
case 'oas2':
|
|
33
|
+
switch (typeName) {
|
|
34
|
+
case 'Schema':
|
|
35
|
+
return 'definitions';
|
|
36
|
+
case 'Parameter':
|
|
37
|
+
return 'parameters';
|
|
38
|
+
case 'Response':
|
|
39
|
+
return 'responses';
|
|
40
|
+
default:
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
case 'async2':
|
|
44
|
+
switch (typeName) {
|
|
45
|
+
case 'Schema':
|
|
46
|
+
return 'schemas';
|
|
47
|
+
case 'Parameter':
|
|
48
|
+
return 'parameters';
|
|
49
|
+
default:
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
case 'async3':
|
|
53
|
+
switch (typeName) {
|
|
54
|
+
case 'Schema':
|
|
55
|
+
return 'schemas';
|
|
56
|
+
case 'Parameter':
|
|
57
|
+
return 'parameters';
|
|
58
|
+
default:
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
case 'arazzo1':
|
|
62
|
+
switch (typeName) {
|
|
63
|
+
case 'Root.workflows_items.parameters_items':
|
|
64
|
+
case 'Root.workflows_items.steps_items.parameters_items':
|
|
65
|
+
return 'parameters';
|
|
66
|
+
default:
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
case 'overlay1':
|
|
70
|
+
switch (typeName) {
|
|
71
|
+
default:
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
case 'openrpc1':
|
|
75
|
+
switch (typeName) {
|
|
76
|
+
case 'ContentDescriptor':
|
|
77
|
+
return 'contentDescriptors';
|
|
78
|
+
case 'Schema':
|
|
79
|
+
return 'schemas';
|
|
80
|
+
case 'Example':
|
|
81
|
+
return 'examples';
|
|
82
|
+
case 'Link':
|
|
83
|
+
return 'links';
|
|
84
|
+
case 'ErrorObject':
|
|
85
|
+
return 'errors';
|
|
86
|
+
case 'ExamplePairing':
|
|
87
|
+
return 'examplePairingObjects';
|
|
88
|
+
case 'Tag':
|
|
89
|
+
return 'tags';
|
|
90
|
+
default:
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export function makeBundleVisitor({ version, dereference, rootDocument, resolvedRefMap, keepUrlRefs, componentRenamingConflicts = 'warn', }) {
|
|
96
|
+
let components;
|
|
97
|
+
let rootLocation;
|
|
98
|
+
const visitor = {
|
|
99
|
+
ref: {
|
|
100
|
+
leave(node, ctx, resolved) {
|
|
101
|
+
if (!resolved.location || resolved.node === undefined) {
|
|
102
|
+
reportUnresolvedRef(resolved, ctx.report, ctx.location);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (resolved.location.source === rootDocument.source &&
|
|
106
|
+
resolved.location.source === ctx.location.source &&
|
|
107
|
+
ctx.type.name !== 'scalar' &&
|
|
108
|
+
!dereference) {
|
|
109
|
+
// Normalize explicit self-file refs to internal pointer
|
|
110
|
+
if (node.$ref !== resolved.location.pointer) {
|
|
111
|
+
node.$ref = resolved.location.pointer;
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (keepUrlRefs && isAbsoluteUrl(node.$ref)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const componentType = mapTypeToComponent(ctx.type.name, version);
|
|
119
|
+
if (!componentType) {
|
|
120
|
+
replaceRef(node, resolved, ctx);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
if (dereference) {
|
|
124
|
+
saveComponent(componentType, resolved, ctx);
|
|
125
|
+
replaceRef(node, resolved, ctx);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
node.$ref = saveComponent(componentType, resolved, ctx);
|
|
129
|
+
resolveBundledComponent(node, resolved, ctx);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
Example: {
|
|
135
|
+
leave(node, ctx) {
|
|
136
|
+
if (isExternalValue(node) && node.value === undefined) {
|
|
137
|
+
const resolved = ctx.resolve({ $ref: node.externalValue });
|
|
138
|
+
if (!resolved.location || resolved.node === undefined) {
|
|
139
|
+
reportUnresolvedRef(resolved, ctx.report, ctx.location);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (keepUrlRefs && isAbsoluteUrl(node.externalValue)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
node.value = ctx.resolve({ $ref: node.externalValue }).node;
|
|
146
|
+
delete node.externalValue;
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
Root: {
|
|
151
|
+
enter(root, ctx) {
|
|
152
|
+
rootLocation = ctx.location;
|
|
153
|
+
if (version === 'oas3') {
|
|
154
|
+
components = root.components = root.components || {};
|
|
155
|
+
}
|
|
156
|
+
else if (version === 'oas2') {
|
|
157
|
+
components = root;
|
|
158
|
+
}
|
|
159
|
+
else if (version === 'async2') {
|
|
160
|
+
components = root.components = root.components || {};
|
|
161
|
+
}
|
|
162
|
+
else if (version === 'async3') {
|
|
163
|
+
components = root.components = root.components || {};
|
|
164
|
+
}
|
|
165
|
+
else if (version === 'arazzo1') {
|
|
166
|
+
components = root.components = root.components || {};
|
|
167
|
+
}
|
|
168
|
+
else if (version === 'openrpc1') {
|
|
169
|
+
components = root.components = root.components || {};
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
if (version === 'oas3') {
|
|
175
|
+
const componentType = mapTypeToComponent('Schema', version);
|
|
176
|
+
visitor.Discriminator = {
|
|
177
|
+
leave(discriminator, ctx) {
|
|
178
|
+
if (typeof discriminator.defaultMapping !== 'string' ||
|
|
179
|
+
!isMappingRef(discriminator.defaultMapping)) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const resolved = ctx.resolve({ $ref: discriminator.defaultMapping });
|
|
183
|
+
if (!resolved.location || resolved.node === undefined) {
|
|
184
|
+
reportUnresolvedRef(resolved, ctx.report, ctx.location.child('defaultMapping'));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
discriminator.defaultMapping = saveComponent(componentType, resolved, ctx);
|
|
188
|
+
},
|
|
189
|
+
DiscriminatorMapping: {
|
|
190
|
+
leave(mapping, ctx) {
|
|
191
|
+
for (const name of Object.keys(mapping)) {
|
|
192
|
+
const $ref = mapping[name];
|
|
193
|
+
if (!isMappingRef($ref)) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const resolved = ctx.resolve({ $ref });
|
|
197
|
+
if (!resolved.location || resolved.node === undefined) {
|
|
198
|
+
reportUnresolvedRef(resolved, ctx.report, ctx.location.child(name));
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
mapping[name] = saveComponent(componentType, resolved, ctx);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function resolveBundledComponent(node, resolved, ctx) {
|
|
208
|
+
const newRefId = makeRefId(ctx.location.source.absoluteRef, node.$ref);
|
|
209
|
+
resolvedRefMap.set(newRefId, {
|
|
210
|
+
document: rootDocument,
|
|
211
|
+
isRemote: false,
|
|
212
|
+
node: resolved.node,
|
|
213
|
+
nodePointer: node.$ref,
|
|
214
|
+
resolved: true,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function saveComponent(componentType, target, ctx) {
|
|
218
|
+
components[componentType] = components[componentType] || {};
|
|
219
|
+
const name = getComponentName(target, componentType, ctx);
|
|
220
|
+
components[componentType][name] = target.node;
|
|
221
|
+
if (version === 'oas3' ||
|
|
222
|
+
version === 'async2' ||
|
|
223
|
+
version === 'async3' ||
|
|
224
|
+
version === 'openrpc1') {
|
|
225
|
+
return `#/components/${componentType}/${name}`;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
return `#/${componentType}/${name}`;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function isEqualOrEqualRef(node, target, ctx) {
|
|
232
|
+
if (isRef(node) &&
|
|
233
|
+
ctx.resolve(node, rootLocation.absolutePointer).location?.absolutePointer ===
|
|
234
|
+
target.location.absolutePointer) {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
return dequal(node, target.node);
|
|
238
|
+
}
|
|
239
|
+
function getComponentName(target, componentType, ctx) {
|
|
240
|
+
const componentsGroup = components[componentType];
|
|
241
|
+
const [fileRef, pointer] = [target.location.source.absoluteRef, target.location.pointer];
|
|
242
|
+
let name = pointerBaseName(pointer) || refBaseName(fileRef);
|
|
243
|
+
const prevName = name;
|
|
244
|
+
let serialId = 2;
|
|
245
|
+
while (componentsGroup[name] && !isEqualOrEqualRef(componentsGroup[name], target, ctx)) {
|
|
246
|
+
name = `${prevName}-${serialId}`;
|
|
247
|
+
serialId++;
|
|
248
|
+
}
|
|
249
|
+
if (!componentsGroup[name] && prevName !== name) {
|
|
250
|
+
ctx.report({
|
|
251
|
+
message: `Two schemas are referenced with the same name but different content. Renamed ${prevName} to ${name}.`,
|
|
252
|
+
location: ctx.location,
|
|
253
|
+
forceSeverity: componentRenamingConflicts,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return name;
|
|
257
|
+
}
|
|
258
|
+
return visitor;
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=bundle-visitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-visitor.js","sourceRoot":"","sources":["../../src/bundle/bundle-visitor.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,UAAU,EACV,eAAe,EACf,KAAK,EACL,eAAe,EACf,WAAW,EAEX,YAAY,GACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,OAAyB;IAC5E,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM;YACT,QAAQ,QAAQ,EAAE,CAAC;gBACjB,KAAK,QAAQ;oBACX,OAAO,SAAS,CAAC;gBACnB,KAAK,WAAW;oBACd,OAAO,YAAY,CAAC;gBACtB,KAAK,UAAU;oBACb,OAAO,WAAW,CAAC;gBACrB,KAAK,SAAS;oBACZ,OAAO,UAAU,CAAC;gBACpB,KAAK,aAAa;oBAChB,OAAO,eAAe,CAAC;gBACzB,KAAK,QAAQ;oBACX,OAAO,SAAS,CAAC;gBACnB,KAAK,gBAAgB;oBACnB,OAAO,iBAAiB,CAAC;gBAC3B,K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AO,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,SAAS,gBAAgB,CACvB,MAA6C,EAC7C,aAAqB,EACrB,GAAgB;QAEhB,MAAM,eAAe,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;QAClD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzF,IAAI,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;QAE5D,MAAM,QAAQ,GAAG,IAAI,CAAC;QACtB,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YACvF,IAAI,GAAG,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC;YACjC,QAAQ,EAAE,CAAC;QACb,CAAC;QAED,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YAChD,GAAG,CAAC,MAAM,CAAC;gBACT,OAAO,EAAE,gFAAgF,QAAQ,OAAO,IAAI,GAAG;gBAC/G,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,aAAa,EAAE,0BAA0B;aAC1C,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Plugin, ResolvedConfig } from '../config/types.js';
|
|
2
|
+
import { type Document, type ResolvedRefMap } from '../resolve.js';
|
|
3
|
+
import type { NormalizedNodeType } from '../types/index.js';
|
|
4
|
+
import type { CollectFn } from '../utils/types.js';
|
|
5
|
+
import { type NormalizedProblem } from '../walk.js';
|
|
6
|
+
import { type CoreBundleOptions } from './bundle-document.js';
|
|
7
|
+
export declare function collectConfigPlugins(document: Document, resolvedRefMap: ResolvedRefMap, rootConfigDir: string): (Plugin | import("../config/config-resolvers.js").PluginResolveInfo)[];
|
|
8
|
+
export declare function bundleConfig(document: Document, resolvedRefMap: ResolvedRefMap, plugins: Plugin[]): ResolvedConfig;
|
|
9
|
+
export declare function bundle(opts: {
|
|
10
|
+
ref?: string;
|
|
11
|
+
doc?: Document;
|
|
12
|
+
collectSpecData?: CollectFn;
|
|
13
|
+
} & CoreBundleOptions): Promise<import("./bundle-document.js").BundleResult>;
|
|
14
|
+
export declare function bundleFromString(opts: {
|
|
15
|
+
source: string;
|
|
16
|
+
absoluteRef?: string;
|
|
17
|
+
} & CoreBundleOptions): Promise<import("./bundle-document.js").BundleResult>;
|
|
18
|
+
export type BundleResult = {
|
|
19
|
+
bundle: Document;
|
|
20
|
+
problems: NormalizedProblem[];
|
|
21
|
+
fileDependencies: Set<string>;
|
|
22
|
+
rootType: NormalizedNodeType;
|
|
23
|
+
refTypes?: Map<string, NormalizedNodeType>;
|
|
24
|
+
visitorsData: Record<string, Record<string, unknown>>;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=bundle.d.ts.map
|