@redocly/openapi-core 0.0.0-snapshot.1744362365 → 0.0.0-snapshot.1744801622
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-many-rules.bench.js +19 -17
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-no-rules.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js +19 -15
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts +1 -2
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js +19 -15
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts +1 -2
- package/lib/benchmark/benches/recommended-oas3.bench.js +18 -15
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts +1 -2
- package/lib/benchmark/benches/resolve-with-no-external.bench.js +17 -14
- package/lib/benchmark/utils.d.ts +4 -5
- package/lib/benchmark/utils.js +14 -11
- package/lib/bundle.d.ts +9 -8
- package/lib/bundle.js +84 -72
- package/lib/config/all.d.ts +1 -2
- package/lib/config/all.js +3 -2
- package/lib/config/builtIn.d.ts +1 -2
- package/lib/config/builtIn.js +49 -44
- package/lib/config/config-resolvers.d.ts +5 -6
- package/lib/config/config-resolvers.js +94 -85
- package/lib/config/config.d.ts +8 -6
- package/lib/config/config.js +73 -66
- package/lib/config/index.d.ts +7 -8
- package/lib/config/index.js +23 -8
- package/lib/config/load.d.ts +8 -5
- package/lib/config/load.js +73 -28
- package/lib/config/minimal.d.ts +1 -2
- package/lib/config/minimal.js +3 -2
- package/lib/config/recommended-strict.d.ts +1 -2
- package/lib/config/recommended-strict.js +3 -2
- package/lib/config/recommended.d.ts +1 -2
- package/lib/config/recommended.js +3 -2
- package/lib/config/rules.d.ts +3 -4
- package/lib/config/rules.js +6 -4
- package/lib/config/spec.d.ts +1 -2
- package/lib/config/spec.js +3 -2
- package/lib/config/types.d.ts +13 -6
- package/lib/config/types.js +2 -2
- package/lib/config/utils.d.ts +2 -3
- package/lib/config/utils.js +89 -75
- package/lib/decorators/arazzo/index.d.ts +0 -1
- package/lib/decorators/arazzo/index.js +4 -2
- package/lib/decorators/async2/index.d.ts +0 -1
- package/lib/decorators/async2/index.js +4 -2
- package/lib/decorators/async3/index.d.ts +0 -1
- package/lib/decorators/async3/index.js +4 -2
- package/lib/decorators/common/filters/filter-helper.d.ts +1 -2
- package/lib/decorators/common/filters/filter-helper.js +12 -9
- package/lib/decorators/common/filters/filter-in.d.ts +1 -2
- package/lib/decorators/common/filters/filter-in.js +8 -5
- package/lib/decorators/common/filters/filter-out.d.ts +1 -2
- package/lib/decorators/common/filters/filter-out.js +8 -5
- package/lib/decorators/common/info-description-override.d.ts +1 -2
- package/lib/decorators/common/info-description-override.js +7 -4
- package/lib/decorators/common/info-override.d.ts +1 -2
- package/lib/decorators/common/info-override.js +5 -2
- package/lib/decorators/common/media-type-examples-override.d.ts +1 -2
- package/lib/decorators/common/media-type-examples-override.js +10 -7
- package/lib/decorators/common/operation-description-override.d.ts +1 -2
- package/lib/decorators/common/operation-description-override.js +7 -4
- package/lib/decorators/common/registry-dependencies.d.ts +2 -0
- package/lib/decorators/common/registry-dependencies.js +24 -0
- package/lib/decorators/common/remove-x-internal.d.ts +1 -2
- package/lib/decorators/common/remove-x-internal.js +14 -11
- package/lib/decorators/common/tag-description-override.d.ts +1 -2
- package/lib/decorators/common/tag-description-override.js +7 -4
- package/lib/decorators/oas2/index.d.ts +2 -2
- package/lib/decorators/oas2/index.js +20 -16
- package/lib/decorators/oas2/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas2/remove-unused-components.js +7 -4
- package/lib/decorators/oas3/index.d.ts +2 -2
- package/lib/decorators/oas3/index.js +22 -18
- package/lib/decorators/oas3/remove-unused-components.d.ts +1 -2
- package/lib/decorators/oas3/remove-unused-components.js +8 -5
- package/lib/decorators/overlay1/index.d.ts +0 -1
- package/lib/decorators/overlay1/index.js +4 -2
- package/lib/env.d.ts +0 -1
- package/lib/env.js +5 -3
- package/lib/format/codeframes.d.ts +1 -2
- package/lib/format/codeframes.js +19 -15
- package/lib/format/format.d.ts +1 -2
- package/lib/format/format.js +62 -57
- package/lib/index.d.ts +26 -29
- package/lib/index.js +98 -24
- package/lib/js-yaml/index.d.ts +0 -1
- package/lib/js-yaml/index.js +11 -7
- package/lib/lint.d.ts +10 -11
- package/lib/lint.js +44 -39
- package/lib/logger.d.ts +1 -2
- package/lib/logger.js +17 -15
- package/lib/oas-types.d.ts +3 -4
- package/lib/oas-types.js +32 -27
- package/lib/output.d.ts +3 -0
- package/lib/output.js +9 -0
- package/lib/redocly/domains.d.ts +14 -0
- package/lib/redocly/domains.js +41 -0
- package/lib/redocly/index.d.ts +30 -0
- package/lib/redocly/index.js +131 -0
- package/lib/redocly/redocly-client-types.d.ts +8 -0
- package/lib/redocly/redocly-client-types.js +2 -0
- package/lib/redocly/registry-api-types.d.ts +29 -0
- package/lib/redocly/registry-api-types.js +2 -0
- package/lib/redocly/registry-api.d.ts +17 -0
- package/lib/redocly/registry-api.js +100 -0
- package/lib/ref-utils.d.ts +2 -3
- package/lib/ref-utils.js +33 -18
- package/lib/resolve.d.ts +2 -3
- package/lib/resolve.js +45 -36
- package/lib/rules/ajv.d.ts +3 -4
- package/lib/rules/ajv.js +10 -7
- package/lib/rules/arazzo/criteria-unique.d.ts +1 -2
- package/lib/rules/arazzo/criteria-unique.js +5 -2
- package/lib/rules/arazzo/index.d.ts +1 -2
- package/lib/rules/arazzo/index.js +35 -33
- package/lib/rules/arazzo/parameters-unique.d.ts +1 -2
- package/lib/rules/arazzo/parameters-unique.js +5 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts +1 -2
- package/lib/rules/arazzo/requestBody-replacements-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescription-type.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescription-type.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js +5 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts +1 -2
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js +5 -2
- package/lib/rules/arazzo/step-onFailure-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onFailure-unique.js +5 -2
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts +1 -2
- package/lib/rules/arazzo/step-onSuccess-unique.js +5 -2
- package/lib/rules/arazzo/stepId-unique.d.ts +1 -2
- package/lib/rules/arazzo/stepId-unique.js +5 -2
- package/lib/rules/arazzo/workflow-dependsOn.d.ts +1 -2
- package/lib/rules/arazzo/workflow-dependsOn.js +5 -2
- package/lib/rules/arazzo/workflowId-unique.d.ts +1 -2
- package/lib/rules/arazzo/workflowId-unique.js +5 -2
- package/lib/rules/async2/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async2/channels-kebab-case.js +5 -2
- package/lib/rules/async2/index.d.ts +1 -2
- package/lib/rules/async2/index.js +24 -22
- package/lib/rules/async2/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async2/no-channel-trailing-slash.js +5 -2
- package/lib/rules/async3/channels-kebab-case.d.ts +1 -2
- package/lib/rules/async3/channels-kebab-case.js +5 -2
- package/lib/rules/async3/index.d.ts +1 -2
- package/lib/rules/async3/index.js +24 -22
- package/lib/rules/async3/no-channel-trailing-slash.d.ts +1 -2
- package/lib/rules/async3/no-channel-trailing-slash.js +6 -3
- package/lib/rules/common/assertions/asserts.d.ts +2 -3
- package/lib/rules/common/assertions/asserts.js +38 -35
- package/lib/rules/common/assertions/index.d.ts +3 -4
- package/lib/rules/common/assertions/index.js +10 -7
- package/lib/rules/common/assertions/utils.d.ts +4 -5
- package/lib/rules/common/assertions/utils.js +29 -21
- package/lib/rules/common/info-contact.d.ts +1 -2
- package/lib/rules/common/info-contact.js +7 -4
- package/lib/rules/common/info-license-strict.d.ts +1 -2
- package/lib/rules/common/info-license-strict.js +10 -7
- package/lib/rules/common/info-license-url.d.ts +1 -2
- package/lib/rules/common/info-license-url.js +7 -4
- package/lib/rules/common/info-license.d.ts +1 -2
- package/lib/rules/common/info-license.js +7 -4
- package/lib/rules/common/no-ambiguous-paths.d.ts +1 -2
- package/lib/rules/common/no-ambiguous-paths.js +5 -2
- package/lib/rules/common/no-enum-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-enum-type-mismatch.js +9 -6
- package/lib/rules/common/no-http-verbs-in-paths.d.ts +1 -2
- package/lib/rules/common/no-http-verbs-in-paths.js +8 -5
- package/lib/rules/common/no-identical-paths.d.ts +1 -2
- package/lib/rules/common/no-identical-paths.js +5 -2
- package/lib/rules/common/no-invalid-parameter-examples.d.ts +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js +9 -6
- package/lib/rules/common/no-invalid-schema-examples.d.ts +1 -2
- package/lib/rules/common/no-invalid-schema-examples.js +9 -6
- package/lib/rules/common/no-path-trailing-slash.d.ts +1 -2
- package/lib/rules/common/no-path-trailing-slash.js +5 -2
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts +1 -2
- package/lib/rules/common/no-required-schema-properties-undefined.js +7 -4
- package/lib/rules/common/no-schema-type-mismatch.d.ts +1 -2
- package/lib/rules/common/no-schema-type-mismatch.js +5 -2
- package/lib/rules/common/operation-2xx-response.d.ts +1 -2
- package/lib/rules/common/operation-2xx-response.js +8 -5
- package/lib/rules/common/operation-4xx-response.d.ts +1 -2
- package/lib/rules/common/operation-4xx-response.js +8 -5
- package/lib/rules/common/operation-description.d.ts +1 -2
- package/lib/rules/common/operation-description.js +7 -4
- package/lib/rules/common/operation-operationId-unique.d.ts +1 -2
- package/lib/rules/common/operation-operationId-unique.js +5 -2
- package/lib/rules/common/operation-operationId-url-safe.d.ts +1 -2
- package/lib/rules/common/operation-operationId-url-safe.js +5 -2
- package/lib/rules/common/operation-operationId.d.ts +1 -2
- package/lib/rules/common/operation-operationId.js +7 -4
- package/lib/rules/common/operation-parameters-unique.d.ts +1 -2
- package/lib/rules/common/operation-parameters-unique.js +5 -2
- package/lib/rules/common/operation-singular-tag.d.ts +1 -2
- package/lib/rules/common/operation-singular-tag.js +5 -2
- package/lib/rules/common/operation-summary.d.ts +1 -2
- package/lib/rules/common/operation-summary.js +7 -4
- package/lib/rules/common/operation-tag-defined.d.ts +1 -2
- package/lib/rules/common/operation-tag-defined.js +5 -2
- package/lib/rules/common/parameter-description.d.ts +1 -2
- package/lib/rules/common/parameter-description.js +5 -2
- package/lib/rules/common/path-declaration-must-exist.d.ts +1 -2
- package/lib/rules/common/path-declaration-must-exist.js +5 -2
- package/lib/rules/common/path-excludes-patterns.d.ts +1 -2
- package/lib/rules/common/path-excludes-patterns.js +5 -2
- package/lib/rules/common/path-http-verbs-order.d.ts +1 -2
- package/lib/rules/common/path-http-verbs-order.js +5 -2
- package/lib/rules/common/path-not-include-query.d.ts +1 -2
- package/lib/rules/common/path-not-include-query.js +5 -2
- package/lib/rules/common/path-params-defined.d.ts +1 -2
- package/lib/rules/common/path-params-defined.js +5 -2
- package/lib/rules/common/path-segment-plural.d.ts +1 -2
- package/lib/rules/common/path-segment-plural.js +8 -5
- package/lib/rules/common/paths-kebab-case.d.ts +1 -2
- package/lib/rules/common/paths-kebab-case.js +5 -2
- package/lib/rules/common/required-string-property-missing-min-length.d.ts +1 -2
- package/lib/rules/common/required-string-property-missing-min-length.js +5 -2
- package/lib/rules/common/response-contains-header.d.ts +1 -2
- package/lib/rules/common/response-contains-header.js +8 -5
- package/lib/rules/common/scalar-property-missing-example.d.ts +1 -2
- package/lib/rules/common/scalar-property-missing-example.js +7 -4
- package/lib/rules/common/security-defined.d.ts +1 -2
- package/lib/rules/common/security-defined.js +5 -2
- package/lib/rules/common/spec-strict-refs.d.ts +1 -2
- package/lib/rules/common/spec-strict-refs.js +7 -4
- package/lib/rules/common/struct.d.ts +1 -2
- package/lib/rules/common/struct.js +21 -18
- package/lib/rules/common/tag-description.d.ts +1 -2
- package/lib/rules/common/tag-description.js +7 -4
- package/lib/rules/common/tags-alphabetical.d.ts +1 -2
- package/lib/rules/common/tags-alphabetical.js +5 -2
- package/lib/rules/no-unresolved-refs.d.ts +3 -4
- package/lib/rules/no-unresolved-refs.js +9 -5
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas2/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas2/index.d.ts +1 -2
- package/lib/rules/oas2/index.js +97 -95
- package/lib/rules/oas2/request-mime-type.d.ts +1 -2
- package/lib/rules/oas2/request-mime-type.js +8 -5
- package/lib/rules/oas2/response-contains-property.d.ts +1 -2
- package/lib/rules/oas2/response-contains-property.js +8 -5
- package/lib/rules/oas2/response-mime-type.d.ts +1 -2
- package/lib/rules/oas2/response-mime-type.js +8 -5
- package/lib/rules/oas3/array-parameter-serialization.d.ts +1 -2
- package/lib/rules/oas3/array-parameter-serialization.js +7 -4
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts +1 -2
- package/lib/rules/oas3/boolean-parameter-prefixes.js +5 -2
- package/lib/rules/oas3/component-name-unique.d.ts +1 -2
- package/lib/rules/oas3/component-name-unique.js +5 -2
- package/lib/rules/oas3/index.d.ts +1 -2
- package/lib/rules/oas3/index.js +121 -119
- package/lib/rules/oas3/no-empty-servers.d.ts +1 -2
- package/lib/rules/oas3/no-empty-servers.js +5 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts +1 -2
- package/lib/rules/oas3/no-example-value-and-externalValue.js +5 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts +1 -2
- package/lib/rules/oas3/no-invalid-media-type-examples.js +10 -7
- package/lib/rules/oas3/no-server-example.com.d.ts +1 -2
- package/lib/rules/oas3/no-server-example.com.js +5 -2
- package/lib/rules/oas3/no-server-trailing-slash.d.ts +1 -2
- package/lib/rules/oas3/no-server-trailing-slash.js +5 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts +1 -2
- package/lib/rules/oas3/no-server-variables-empty-enum.js +5 -2
- package/lib/rules/oas3/no-undefined-server-variable.d.ts +1 -2
- package/lib/rules/oas3/no-undefined-server-variable.js +5 -2
- package/lib/rules/oas3/no-unused-components.d.ts +1 -2
- package/lib/rules/oas3/no-unused-components.js +5 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +1 -2
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +9 -6
- package/lib/rules/oas3/request-mime-type.d.ts +1 -2
- package/lib/rules/oas3/request-mime-type.js +9 -6
- package/lib/rules/oas3/response-contains-property.d.ts +1 -2
- package/lib/rules/oas3/response-contains-property.js +8 -5
- package/lib/rules/oas3/response-mime-type.d.ts +1 -2
- package/lib/rules/oas3/response-mime-type.js +9 -6
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts +1 -2
- package/lib/rules/oas3/spec-components-invalid-map-name.js +5 -2
- package/lib/rules/other/stats.d.ts +3 -4
- package/lib/rules/other/stats.js +5 -2
- package/lib/rules/overlay1/index.d.ts +1 -2
- package/lib/rules/overlay1/index.js +11 -9
- package/lib/rules/respect/no-criteria-xpath.d.ts +1 -2
- package/lib/rules/respect/no-criteria-xpath.js +5 -2
- package/lib/rules/respect/respect-supported-versions.d.ts +1 -2
- package/lib/rules/respect/respect-supported-versions.js +10 -7
- package/lib/rules/utils.d.ts +3 -4
- package/lib/rules/utils.js +36 -23
- package/lib/types/arazzo.d.ts +1 -2
- package/lib/types/arazzo.js +23 -21
- package/lib/types/asyncapi2.d.ts +1 -2
- package/lib/types/asyncapi2.js +56 -54
- package/lib/types/asyncapi3.d.ts +1 -2
- package/lib/types/asyncapi3.js +43 -41
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +13 -7
- package/lib/types/json-schema-adapter.d.ts +1 -2
- package/lib/types/json-schema-adapter.js +17 -15
- package/lib/types/oas2.d.ts +2 -3
- package/lib/types/oas2.js +19 -17
- package/lib/types/oas3.d.ts +2 -3
- package/lib/types/oas3.js +41 -39
- package/lib/types/oas3_1.d.ts +2 -3
- package/lib/types/oas3_1.js +20 -18
- package/lib/types/overlay.d.ts +1 -2
- package/lib/types/overlay.js +6 -4
- package/lib/types/redocly-yaml.d.ts +3 -4
- package/lib/types/redocly-yaml.js +48 -31
- package/lib/typings/arazzo.d.ts +0 -1
- package/lib/typings/arazzo.js +5 -3
- package/lib/typings/asyncapi.d.ts +0 -1
- package/lib/typings/asyncapi.js +2 -2
- package/lib/typings/asyncapi3.d.ts +0 -1
- package/lib/typings/asyncapi3.js +2 -2
- package/lib/typings/common.d.ts +0 -1
- package/lib/typings/common.js +2 -2
- package/lib/typings/openapi.d.ts +0 -1
- package/lib/typings/openapi.js +2 -2
- package/lib/typings/overlay.d.ts +0 -1
- package/lib/typings/overlay.js +4 -2
- package/lib/typings/swagger.d.ts +1 -2
- package/lib/typings/swagger.js +2 -2
- package/lib/utils.d.ts +5 -4
- package/lib/utils.js +99 -52
- package/lib/visitors.d.ts +10 -11
- package/lib/visitors.js +6 -4
- package/lib/walk.d.ts +8 -9
- package/lib/walk.js +25 -23
- package/package.json +9 -30
- package/lib/benchmark/benches/lint-with-many-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-many-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-nested-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-no-rules.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule-report.bench.js.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/lint-with-top-level-rule.bench.js.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/recommended-oas3.bench.js.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.d.ts.map +0 -1
- package/lib/benchmark/benches/resolve-with-no-external.bench.js.map +0 -1
- package/lib/benchmark/utils.d.ts.map +0 -1
- package/lib/benchmark/utils.js.map +0 -1
- package/lib/bundle.d.ts.map +0 -1
- package/lib/bundle.js.map +0 -1
- package/lib/config/all.d.ts.map +0 -1
- package/lib/config/all.js.map +0 -1
- package/lib/config/builtIn.d.ts.map +0 -1
- package/lib/config/builtIn.js.map +0 -1
- package/lib/config/config-resolvers.d.ts.map +0 -1
- package/lib/config/config-resolvers.js.map +0 -1
- package/lib/config/config.d.ts.map +0 -1
- package/lib/config/config.js.map +0 -1
- package/lib/config/index.d.ts.map +0 -1
- package/lib/config/index.js.map +0 -1
- package/lib/config/load.d.ts.map +0 -1
- package/lib/config/load.js.map +0 -1
- package/lib/config/minimal.d.ts.map +0 -1
- package/lib/config/minimal.js.map +0 -1
- package/lib/config/recommended-strict.d.ts.map +0 -1
- package/lib/config/recommended-strict.js.map +0 -1
- package/lib/config/recommended.d.ts.map +0 -1
- package/lib/config/recommended.js.map +0 -1
- package/lib/config/rules.d.ts.map +0 -1
- package/lib/config/rules.js.map +0 -1
- package/lib/config/spec.d.ts.map +0 -1
- package/lib/config/spec.js.map +0 -1
- package/lib/config/types.d.ts.map +0 -1
- package/lib/config/types.js.map +0 -1
- package/lib/config/utils.d.ts.map +0 -1
- package/lib/config/utils.js.map +0 -1
- package/lib/decorators/arazzo/index.d.ts.map +0 -1
- package/lib/decorators/arazzo/index.js.map +0 -1
- package/lib/decorators/async2/index.d.ts.map +0 -1
- package/lib/decorators/async2/index.js.map +0 -1
- package/lib/decorators/async3/index.d.ts.map +0 -1
- package/lib/decorators/async3/index.js.map +0 -1
- package/lib/decorators/common/filters/filter-helper.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-helper.js.map +0 -1
- package/lib/decorators/common/filters/filter-in.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-in.js.map +0 -1
- package/lib/decorators/common/filters/filter-out.d.ts.map +0 -1
- package/lib/decorators/common/filters/filter-out.js.map +0 -1
- package/lib/decorators/common/info-description-override.d.ts.map +0 -1
- package/lib/decorators/common/info-description-override.js.map +0 -1
- package/lib/decorators/common/info-override.d.ts.map +0 -1
- package/lib/decorators/common/info-override.js.map +0 -1
- package/lib/decorators/common/media-type-examples-override.d.ts.map +0 -1
- package/lib/decorators/common/media-type-examples-override.js.map +0 -1
- package/lib/decorators/common/operation-description-override.d.ts.map +0 -1
- package/lib/decorators/common/operation-description-override.js.map +0 -1
- package/lib/decorators/common/remove-x-internal.d.ts.map +0 -1
- package/lib/decorators/common/remove-x-internal.js.map +0 -1
- package/lib/decorators/common/tag-description-override.d.ts.map +0 -1
- package/lib/decorators/common/tag-description-override.js.map +0 -1
- package/lib/decorators/oas2/index.d.ts.map +0 -1
- package/lib/decorators/oas2/index.js.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas2/remove-unused-components.js.map +0 -1
- package/lib/decorators/oas3/index.d.ts.map +0 -1
- package/lib/decorators/oas3/index.js.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.d.ts.map +0 -1
- package/lib/decorators/oas3/remove-unused-components.js.map +0 -1
- package/lib/decorators/overlay1/index.d.ts.map +0 -1
- package/lib/decorators/overlay1/index.js.map +0 -1
- package/lib/env.d.ts.map +0 -1
- package/lib/env.js.map +0 -1
- package/lib/format/codeframes.d.ts.map +0 -1
- package/lib/format/codeframes.js.map +0 -1
- package/lib/format/format.d.ts.map +0 -1
- package/lib/format/format.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/js-yaml/index.d.ts.map +0 -1
- package/lib/js-yaml/index.js.map +0 -1
- package/lib/lint.d.ts.map +0 -1
- package/lib/lint.js.map +0 -1
- package/lib/logger.d.ts.map +0 -1
- package/lib/logger.js.map +0 -1
- package/lib/oas-types.d.ts.map +0 -1
- package/lib/oas-types.js.map +0 -1
- package/lib/ref-utils.d.ts.map +0 -1
- package/lib/ref-utils.js.map +0 -1
- package/lib/resolve.d.ts.map +0 -1
- package/lib/resolve.js.map +0 -1
- package/lib/rules/ajv.d.ts.map +0 -1
- package/lib/rules/ajv.js.map +0 -1
- package/lib/rules/arazzo/criteria-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/criteria-unique.js.map +0 -1
- package/lib/rules/arazzo/index.d.ts.map +0 -1
- package/lib/rules/arazzo/index.js.map +0 -1
- package/lib/rules/arazzo/parameters-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/parameters-unique.js.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/requestBody-replacements-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescription-type.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-name-unique.js.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.d.ts.map +0 -1
- package/lib/rules/arazzo/sourceDescriptions-not-empty.js.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onFailure-unique.js.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/step-onSuccess-unique.js.map +0 -1
- package/lib/rules/arazzo/stepId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/stepId-unique.js.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.d.ts.map +0 -1
- package/lib/rules/arazzo/workflow-dependsOn.js.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.d.ts.map +0 -1
- package/lib/rules/arazzo/workflowId-unique.js.map +0 -1
- package/lib/rules/async2/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async2/channels-kebab-case.js.map +0 -1
- package/lib/rules/async2/index.d.ts.map +0 -1
- package/lib/rules/async2/index.js.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async2/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/async3/channels-kebab-case.d.ts.map +0 -1
- package/lib/rules/async3/channels-kebab-case.js.map +0 -1
- package/lib/rules/async3/index.d.ts.map +0 -1
- package/lib/rules/async3/index.js.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.d.ts.map +0 -1
- package/lib/rules/async3/no-channel-trailing-slash.js.map +0 -1
- package/lib/rules/common/assertions/asserts.d.ts.map +0 -1
- package/lib/rules/common/assertions/asserts.js.map +0 -1
- package/lib/rules/common/assertions/index.d.ts.map +0 -1
- package/lib/rules/common/assertions/index.js.map +0 -1
- package/lib/rules/common/assertions/utils.d.ts.map +0 -1
- package/lib/rules/common/assertions/utils.js.map +0 -1
- package/lib/rules/common/info-contact.d.ts.map +0 -1
- package/lib/rules/common/info-contact.js.map +0 -1
- package/lib/rules/common/info-license-strict.d.ts.map +0 -1
- package/lib/rules/common/info-license-strict.js.map +0 -1
- package/lib/rules/common/info-license-url.d.ts.map +0 -1
- package/lib/rules/common/info-license-url.js.map +0 -1
- package/lib/rules/common/info-license.d.ts.map +0 -1
- package/lib/rules/common/info-license.js.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.d.ts.map +0 -1
- package/lib/rules/common/no-ambiguous-paths.js.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-enum-type-mismatch.js.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.d.ts.map +0 -1
- package/lib/rules/common/no-http-verbs-in-paths.js.map +0 -1
- package/lib/rules/common/no-identical-paths.d.ts.map +0 -1
- package/lib/rules/common/no-identical-paths.js.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-parameter-examples.js.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.d.ts.map +0 -1
- package/lib/rules/common/no-invalid-schema-examples.js.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.d.ts.map +0 -1
- package/lib/rules/common/no-path-trailing-slash.js.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +0 -1
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.d.ts.map +0 -1
- package/lib/rules/common/no-schema-type-mismatch.js.map +0 -1
- package/lib/rules/common/operation-2xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-2xx-response.js.map +0 -1
- package/lib/rules/common/operation-4xx-response.d.ts.map +0 -1
- package/lib/rules/common/operation-4xx-response.js.map +0 -1
- package/lib/rules/common/operation-description.d.ts.map +0 -1
- package/lib/rules/common/operation-description.js.map +0 -1
- package/lib/rules/common/operation-operationId-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-unique.js.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId-url-safe.js.map +0 -1
- package/lib/rules/common/operation-operationId.d.ts.map +0 -1
- package/lib/rules/common/operation-operationId.js.map +0 -1
- package/lib/rules/common/operation-parameters-unique.d.ts.map +0 -1
- package/lib/rules/common/operation-parameters-unique.js.map +0 -1
- package/lib/rules/common/operation-singular-tag.d.ts.map +0 -1
- package/lib/rules/common/operation-singular-tag.js.map +0 -1
- package/lib/rules/common/operation-summary.d.ts.map +0 -1
- package/lib/rules/common/operation-summary.js.map +0 -1
- package/lib/rules/common/operation-tag-defined.d.ts.map +0 -1
- package/lib/rules/common/operation-tag-defined.js.map +0 -1
- package/lib/rules/common/parameter-description.d.ts.map +0 -1
- package/lib/rules/common/parameter-description.js.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.d.ts.map +0 -1
- package/lib/rules/common/path-declaration-must-exist.js.map +0 -1
- package/lib/rules/common/path-excludes-patterns.d.ts.map +0 -1
- package/lib/rules/common/path-excludes-patterns.js.map +0 -1
- package/lib/rules/common/path-http-verbs-order.d.ts.map +0 -1
- package/lib/rules/common/path-http-verbs-order.js.map +0 -1
- package/lib/rules/common/path-not-include-query.d.ts.map +0 -1
- package/lib/rules/common/path-not-include-query.js.map +0 -1
- package/lib/rules/common/path-params-defined.d.ts.map +0 -1
- package/lib/rules/common/path-params-defined.js.map +0 -1
- package/lib/rules/common/path-segment-plural.d.ts.map +0 -1
- package/lib/rules/common/path-segment-plural.js.map +0 -1
- package/lib/rules/common/paths-kebab-case.d.ts.map +0 -1
- package/lib/rules/common/paths-kebab-case.js.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.d.ts.map +0 -1
- package/lib/rules/common/required-string-property-missing-min-length.js.map +0 -1
- package/lib/rules/common/response-contains-header.d.ts.map +0 -1
- package/lib/rules/common/response-contains-header.js.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.d.ts.map +0 -1
- package/lib/rules/common/scalar-property-missing-example.js.map +0 -1
- package/lib/rules/common/security-defined.d.ts.map +0 -1
- package/lib/rules/common/security-defined.js.map +0 -1
- package/lib/rules/common/spec-strict-refs.d.ts.map +0 -1
- package/lib/rules/common/spec-strict-refs.js.map +0 -1
- package/lib/rules/common/struct.d.ts.map +0 -1
- package/lib/rules/common/struct.js.map +0 -1
- package/lib/rules/common/tag-description.d.ts.map +0 -1
- package/lib/rules/common/tag-description.js.map +0 -1
- package/lib/rules/common/tags-alphabetical.d.ts.map +0 -1
- package/lib/rules/common/tags-alphabetical.js.map +0 -1
- package/lib/rules/no-unresolved-refs.d.ts.map +0 -1
- package/lib/rules/no-unresolved-refs.js.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas2/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas2/index.d.ts.map +0 -1
- package/lib/rules/oas2/index.js.map +0 -1
- package/lib/rules/oas2/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/request-mime-type.js.map +0 -1
- package/lib/rules/oas2/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas2/response-contains-property.js.map +0 -1
- package/lib/rules/oas2/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas2/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.d.ts.map +0 -1
- package/lib/rules/oas3/array-parameter-serialization.js.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.d.ts.map +0 -1
- package/lib/rules/oas3/boolean-parameter-prefixes.js.map +0 -1
- package/lib/rules/oas3/component-name-unique.d.ts.map +0 -1
- package/lib/rules/oas3/component-name-unique.js.map +0 -1
- package/lib/rules/oas3/index.d.ts.map +0 -1
- package/lib/rules/oas3/index.js.map +0 -1
- package/lib/rules/oas3/no-empty-servers.d.ts.map +0 -1
- package/lib/rules/oas3/no-empty-servers.js.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.d.ts.map +0 -1
- package/lib/rules/oas3/no-example-value-and-externalValue.js.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.d.ts.map +0 -1
- package/lib/rules/oas3/no-invalid-media-type-examples.js.map +0 -1
- package/lib/rules/oas3/no-server-example.com.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-example.com.js.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-trailing-slash.js.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.d.ts.map +0 -1
- package/lib/rules/oas3/no-server-variables-empty-enum.js.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.d.ts.map +0 -1
- package/lib/rules/oas3/no-undefined-server-variable.js.map +0 -1
- package/lib/rules/oas3/no-unused-components.d.ts.map +0 -1
- package/lib/rules/oas3/no-unused-components.js.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts.map +0 -1
- package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js.map +0 -1
- package/lib/rules/oas3/request-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/request-mime-type.js.map +0 -1
- package/lib/rules/oas3/response-contains-property.d.ts.map +0 -1
- package/lib/rules/oas3/response-contains-property.js.map +0 -1
- package/lib/rules/oas3/response-mime-type.d.ts.map +0 -1
- package/lib/rules/oas3/response-mime-type.js.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.d.ts.map +0 -1
- package/lib/rules/oas3/spec-components-invalid-map-name.js.map +0 -1
- package/lib/rules/other/stats.d.ts.map +0 -1
- package/lib/rules/other/stats.js.map +0 -1
- package/lib/rules/overlay1/index.d.ts.map +0 -1
- package/lib/rules/overlay1/index.js.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.d.ts.map +0 -1
- package/lib/rules/respect/no-criteria-xpath.js.map +0 -1
- package/lib/rules/respect/respect-supported-versions.d.ts.map +0 -1
- package/lib/rules/respect/respect-supported-versions.js.map +0 -1
- package/lib/rules/utils.d.ts.map +0 -1
- package/lib/rules/utils.js.map +0 -1
- package/lib/types/arazzo.d.ts.map +0 -1
- package/lib/types/arazzo.js.map +0 -1
- package/lib/types/asyncapi2.d.ts.map +0 -1
- package/lib/types/asyncapi2.js.map +0 -1
- package/lib/types/asyncapi3.d.ts.map +0 -1
- package/lib/types/asyncapi3.js.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/index.js.map +0 -1
- package/lib/types/json-schema-adapter.d.ts.map +0 -1
- package/lib/types/json-schema-adapter.js.map +0 -1
- package/lib/types/oas2.d.ts.map +0 -1
- package/lib/types/oas2.js.map +0 -1
- package/lib/types/oas3.d.ts.map +0 -1
- package/lib/types/oas3.js.map +0 -1
- package/lib/types/oas3_1.d.ts.map +0 -1
- package/lib/types/oas3_1.js.map +0 -1
- package/lib/types/overlay.d.ts.map +0 -1
- package/lib/types/overlay.js.map +0 -1
- package/lib/types/redocly-yaml.d.ts.map +0 -1
- package/lib/types/redocly-yaml.js.map +0 -1
- package/lib/typings/arazzo.d.ts.map +0 -1
- package/lib/typings/arazzo.js.map +0 -1
- package/lib/typings/asyncapi.d.ts.map +0 -1
- package/lib/typings/asyncapi.js.map +0 -1
- package/lib/typings/asyncapi3.d.ts.map +0 -1
- package/lib/typings/asyncapi3.js.map +0 -1
- package/lib/typings/common.d.ts.map +0 -1
- package/lib/typings/common.js.map +0 -1
- package/lib/typings/openapi.d.ts.map +0 -1
- package/lib/typings/openapi.js.map +0 -1
- package/lib/typings/overlay.d.ts.map +0 -1
- package/lib/typings/overlay.js.map +0 -1
- package/lib/typings/swagger.d.ts.map +0 -1
- package/lib/typings/swagger.js.map +0 -1
- package/lib/utils/error.d.ts +0 -3
- package/lib/utils/error.d.ts.map +0 -1
- package/lib/utils/error.js +0 -3
- package/lib/utils/error.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/lib/visitors.d.ts.map +0 -1
- package/lib/visitors.js.map +0 -1
- package/lib/walk.d.ts.map +0 -1
- package/lib/walk.js.map +0 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Struct = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const ref_utils_1 = require("../../ref-utils");
|
|
7
|
+
const utils_2 = require("../../utils");
|
|
8
|
+
const Struct = () => {
|
|
6
9
|
return {
|
|
7
10
|
any(node, { report, type, location, rawLocation, key, resolve, ignoreNextVisitorsOnNode }) {
|
|
8
|
-
const nodeType = oasTypeOf(node);
|
|
11
|
+
const nodeType = (0, utils_1.oasTypeOf)(node);
|
|
9
12
|
const refLocation = rawLocation !== location ? rawLocation : undefined;
|
|
10
13
|
if (type.items) {
|
|
11
14
|
if (nodeType !== 'array') {
|
|
@@ -18,7 +21,7 @@ export const Struct = () => {
|
|
|
18
21
|
return;
|
|
19
22
|
}
|
|
20
23
|
else if (nodeType !== 'object') {
|
|
21
|
-
if (type !== SpecExtension) {
|
|
24
|
+
if (type !== types_1.SpecExtension) {
|
|
22
25
|
// do not validate unknown extensions structure
|
|
23
26
|
report({
|
|
24
27
|
message: `Expected type \`${type.name}\` (object) but got \`${nodeType}\``,
|
|
@@ -39,7 +42,7 @@ export const Struct = () => {
|
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
const allowed = type.allowed?.(node);
|
|
42
|
-
if (allowed && isPlainObject(node)) {
|
|
45
|
+
if (allowed && (0, utils_2.isPlainObject)(node)) {
|
|
43
46
|
for (const propName in node) {
|
|
44
47
|
if (allowed.includes(propName) ||
|
|
45
48
|
(type.extensionsPrefix && propName.startsWith(type.extensionsPrefix)) ||
|
|
@@ -76,17 +79,17 @@ export const Struct = () => {
|
|
|
76
79
|
propType = type.additionalProperties;
|
|
77
80
|
if (typeof propType === 'function')
|
|
78
81
|
propType = propType(propValue, propName);
|
|
79
|
-
if (isNamedType(propType)) {
|
|
82
|
+
if ((0, types_1.isNamedType)(propType)) {
|
|
80
83
|
continue; // do nothing for named schema, it is executed with the next any call
|
|
81
84
|
}
|
|
82
85
|
const propSchema = propType;
|
|
83
|
-
const propValueType = oasTypeOf(propValue);
|
|
86
|
+
const propValueType = (0, utils_1.oasTypeOf)(propValue);
|
|
84
87
|
if (propSchema === undefined) {
|
|
85
88
|
if (propName.startsWith('x-'))
|
|
86
89
|
continue;
|
|
87
90
|
report({
|
|
88
91
|
message: `Property \`${propName}\` is not expected here.`,
|
|
89
|
-
suggest: getSuggest(propName, Object.keys(type.properties)),
|
|
92
|
+
suggest: (0, utils_1.getSuggest)(propName, Object.keys(type.properties)),
|
|
90
93
|
from: refLocation,
|
|
91
94
|
location: propLocation.key(),
|
|
92
95
|
});
|
|
@@ -95,24 +98,24 @@ export const Struct = () => {
|
|
|
95
98
|
if (propSchema === null) {
|
|
96
99
|
continue; // just defined, no validation
|
|
97
100
|
}
|
|
98
|
-
if (propSchema.resolvable !== false && isRef(propValue)) {
|
|
101
|
+
if (propSchema.resolvable !== false && (0, ref_utils_1.isRef)(propValue)) {
|
|
99
102
|
propValue = resolve(propValue).node;
|
|
100
103
|
}
|
|
101
104
|
if (propSchema.items && propSchema.items?.enum && Array.isArray(propValue)) {
|
|
102
105
|
for (let i = 0; i < propValue.length; i++) {
|
|
103
|
-
validateSchemaEnumType(propSchema.items?.enum, propValue[i], propName, refLocation, {
|
|
106
|
+
(0, utils_1.validateSchemaEnumType)(propSchema.items?.enum, propValue[i], propName, refLocation, {
|
|
104
107
|
report,
|
|
105
108
|
location: location.child([propName, i]),
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
if (propSchema.enum) {
|
|
110
|
-
validateSchemaEnumType(propSchema.enum, propValue, propName, refLocation, {
|
|
113
|
+
(0, utils_1.validateSchemaEnumType)(propSchema.enum, propValue, propName, refLocation, {
|
|
111
114
|
report,
|
|
112
115
|
location: location.child([propName]),
|
|
113
116
|
});
|
|
114
117
|
}
|
|
115
|
-
else if (propSchema.type && !matchesJsonSchemaType(propValue, propSchema.type, false)) {
|
|
118
|
+
else if (propSchema.type && !(0, utils_1.matchesJsonSchemaType)(propValue, propSchema.type, false)) {
|
|
116
119
|
report({
|
|
117
120
|
message: `Expected type \`${propSchema.type}\` but got \`${propValueType}\`.`,
|
|
118
121
|
from: refLocation,
|
|
@@ -124,9 +127,9 @@ export const Struct = () => {
|
|
|
124
127
|
const itemsType = propSchema.items?.type;
|
|
125
128
|
for (let i = 0; i < propValue.length; i++) {
|
|
126
129
|
const item = propValue[i];
|
|
127
|
-
if (!matchesJsonSchemaType(item, itemsType, false)) {
|
|
130
|
+
if (!(0, utils_1.matchesJsonSchemaType)(item, itemsType, false)) {
|
|
128
131
|
report({
|
|
129
|
-
message: `Expected type \`${itemsType}\` but got \`${oasTypeOf(item)}\`.`,
|
|
132
|
+
message: `Expected type \`${itemsType}\` but got \`${(0, utils_1.oasTypeOf)(item)}\`.`,
|
|
130
133
|
from: refLocation,
|
|
131
134
|
location: propLocation.child([i]),
|
|
132
135
|
});
|
|
@@ -152,4 +155,4 @@ export const Struct = () => {
|
|
|
152
155
|
},
|
|
153
156
|
};
|
|
154
157
|
};
|
|
155
|
-
|
|
158
|
+
exports.Struct = Struct;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagDescription = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const TagDescription = () => {
|
|
3
6
|
return {
|
|
4
7
|
Tag(tag, ctx) {
|
|
5
|
-
validateDefinedAndNonEmpty('description', tag, ctx);
|
|
8
|
+
(0, utils_1.validateDefinedAndNonEmpty)('description', tag, ctx);
|
|
6
9
|
},
|
|
7
10
|
};
|
|
8
11
|
};
|
|
9
|
-
|
|
12
|
+
exports.TagDescription = TagDescription;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagsAlphabetical = void 0;
|
|
4
|
+
const TagsAlphabetical = ({ ignoreCase = false }) => {
|
|
2
5
|
return {
|
|
3
6
|
Root(root, { report, location }) {
|
|
4
7
|
if (!root.tags)
|
|
@@ -14,7 +17,7 @@ export const TagsAlphabetical = ({ ignoreCase = false }) => {
|
|
|
14
17
|
},
|
|
15
18
|
};
|
|
16
19
|
};
|
|
20
|
+
exports.TagsAlphabetical = TagsAlphabetical;
|
|
17
21
|
function getTagName(tag, ignoreCase) {
|
|
18
22
|
return ignoreCase ? tag.name.toLowerCase() : tag.name;
|
|
19
23
|
}
|
|
20
|
-
//# sourceMappingURL=tags-alphabetical.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Oas3Rule } from '../visitors
|
|
2
|
-
import type { ResolveResult, Problem } from '../walk
|
|
3
|
-
import type { Location } from '../ref-utils
|
|
1
|
+
import type { Oas3Rule } from '../visitors';
|
|
2
|
+
import type { ResolveResult, Problem } from '../walk';
|
|
3
|
+
import type { Location } from '../ref-utils';
|
|
4
4
|
export declare const NoUnresolvedRefs: Oas3Rule;
|
|
5
5
|
export declare function reportUnresolvedRef(resolved: ResolveResult<any>, report: (m: Problem) => void, location: Location): void;
|
|
6
|
-
//# sourceMappingURL=no-unresolved-refs.d.ts.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoUnresolvedRefs = void 0;
|
|
4
|
+
exports.reportUnresolvedRef = reportUnresolvedRef;
|
|
5
|
+
const resolve_1 = require("../resolve");
|
|
6
|
+
const NoUnresolvedRefs = () => {
|
|
3
7
|
return {
|
|
4
8
|
ref: {
|
|
5
9
|
leave(_, { report, location }, resolved) {
|
|
@@ -18,9 +22,10 @@ export const NoUnresolvedRefs = () => {
|
|
|
18
22
|
},
|
|
19
23
|
};
|
|
20
24
|
};
|
|
21
|
-
|
|
25
|
+
exports.NoUnresolvedRefs = NoUnresolvedRefs;
|
|
26
|
+
function reportUnresolvedRef(resolved, report, location) {
|
|
22
27
|
const error = resolved.error;
|
|
23
|
-
if (error instanceof YamlParseError) {
|
|
28
|
+
if (error instanceof resolve_1.YamlParseError) {
|
|
24
29
|
report({
|
|
25
30
|
message: 'Failed to parse: ' + error.message,
|
|
26
31
|
location: {
|
|
@@ -39,4 +44,3 @@ export function reportUnresolvedRef(resolved, report, location) {
|
|
|
39
44
|
message: `Can't resolve $ref${message ? ': ' + message : ''}`,
|
|
40
45
|
});
|
|
41
46
|
}
|
|
42
|
-
//# sourceMappingURL=no-unresolved-refs.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Oas2Rule } from '../../visitors
|
|
1
|
+
import type { Oas2Rule } from '../../visitors';
|
|
2
2
|
export type BooleanParameterPrefixesOptions = {
|
|
3
3
|
prefixes?: string[];
|
|
4
4
|
};
|
|
5
5
|
export declare const BooleanParameterPrefixes: Oas2Rule;
|
|
6
|
-
//# sourceMappingURL=boolean-parameter-prefixes.d.ts.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanParameterPrefixes = void 0;
|
|
4
|
+
const BooleanParameterPrefixes = (options) => {
|
|
2
5
|
const prefixes = options.prefixes || ['is', 'has'];
|
|
3
6
|
const regexp = new RegExp(`^(${prefixes.join('|')})[A-Z-_]`);
|
|
4
7
|
const wrappedPrefixes = prefixes.map((p) => `\`${p}\``);
|
|
@@ -16,4 +19,4 @@ export const BooleanParameterPrefixes = (options) => {
|
|
|
16
19
|
},
|
|
17
20
|
};
|
|
18
21
|
};
|
|
19
|
-
|
|
22
|
+
exports.BooleanParameterPrefixes = BooleanParameterPrefixes;
|
package/lib/rules/oas2/index.js
CHANGED
|
@@ -1,98 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.preprocessors = exports.rules = void 0;
|
|
4
|
+
const struct_1 = require("../common/struct");
|
|
5
|
+
const no_invalid_schema_examples_1 = require("../common/no-invalid-schema-examples");
|
|
6
|
+
const no_invalid_parameter_examples_1 = require("../common/no-invalid-parameter-examples");
|
|
7
|
+
const info_contact_1 = require("../common/info-contact");
|
|
8
|
+
const info_license_1 = require("../common/info-license");
|
|
9
|
+
const info_license_url_1 = require("../common/info-license-url");
|
|
10
|
+
const info_license_strict_1 = require("../common/info-license-strict");
|
|
11
|
+
const boolean_parameter_prefixes_1 = require("./boolean-parameter-prefixes");
|
|
12
|
+
const tag_description_1 = require("../common/tag-description");
|
|
13
|
+
const tags_alphabetical_1 = require("../common/tags-alphabetical");
|
|
14
|
+
const paths_kebab_case_1 = require("../common/paths-kebab-case");
|
|
15
|
+
const no_enum_type_mismatch_1 = require("../common/no-enum-type-mismatch");
|
|
16
|
+
const no_path_trailing_slash_1 = require("../common/no-path-trailing-slash");
|
|
17
|
+
const operation_2xx_response_1 = require("../common/operation-2xx-response");
|
|
18
|
+
const operation_4xx_response_1 = require("../common/operation-4xx-response");
|
|
19
|
+
const assertions_1 = require("../common/assertions");
|
|
20
|
+
const operation_operationId_unique_1 = require("../common/operation-operationId-unique");
|
|
21
|
+
const operation_parameters_unique_1 = require("../common/operation-parameters-unique");
|
|
22
|
+
const path_params_defined_1 = require("../common/path-params-defined");
|
|
23
|
+
const operation_tag_defined_1 = require("../common/operation-tag-defined");
|
|
24
|
+
const path_declaration_must_exist_1 = require("../common/path-declaration-must-exist");
|
|
25
|
+
const operation_operationId_url_safe_1 = require("../common/operation-operationId-url-safe");
|
|
26
|
+
const operation_description_1 = require("../common/operation-description");
|
|
27
|
+
const path_not_include_query_1 = require("../common/path-not-include-query");
|
|
28
|
+
const parameter_description_1 = require("../common/parameter-description");
|
|
29
|
+
const operation_singular_tag_1 = require("../common/operation-singular-tag");
|
|
30
|
+
const security_defined_1 = require("../common/security-defined");
|
|
31
|
+
const no_unresolved_refs_1 = require("../no-unresolved-refs");
|
|
32
|
+
const path_http_verbs_order_1 = require("../common/path-http-verbs-order");
|
|
33
|
+
const no_identical_paths_1 = require("../common/no-identical-paths");
|
|
34
|
+
const operation_operationId_1 = require("../common/operation-operationId");
|
|
35
|
+
const operation_summary_1 = require("../common/operation-summary");
|
|
36
|
+
const no_ambiguous_paths_1 = require("../common/no-ambiguous-paths");
|
|
37
|
+
const no_http_verbs_in_paths_1 = require("../common/no-http-verbs-in-paths");
|
|
38
|
+
const path_excludes_patterns_1 = require("../common/path-excludes-patterns");
|
|
39
|
+
const request_mime_type_1 = require("./request-mime-type");
|
|
40
|
+
const response_mime_type_1 = require("./response-mime-type");
|
|
41
|
+
const path_segment_plural_1 = require("../common/path-segment-plural");
|
|
42
|
+
const response_contains_header_1 = require("../common/response-contains-header");
|
|
43
|
+
const response_contains_property_1 = require("./response-contains-property");
|
|
44
|
+
const scalar_property_missing_example_1 = require("../common/scalar-property-missing-example");
|
|
45
|
+
const required_string_property_missing_min_length_1 = require("../common/required-string-property-missing-min-length");
|
|
46
|
+
const spec_strict_refs_1 = require("../common/spec-strict-refs");
|
|
47
|
+
const no_required_schema_properties_undefined_1 = require("../common/no-required-schema-properties-undefined");
|
|
48
|
+
const no_schema_type_mismatch_1 = require("../common/no-schema-type-mismatch");
|
|
49
|
+
exports.rules = {
|
|
47
50
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
51
|
//@ts-ignore TODO: This is depricated property `spec` and should be removed in the future
|
|
49
|
-
spec: Struct,
|
|
50
|
-
struct: Struct,
|
|
51
|
-
'no-invalid-schema-examples': NoInvalidSchemaExamples,
|
|
52
|
-
'no-invalid-parameter-examples': NoInvalidParameterExamples,
|
|
53
|
-
'info-contact': InfoContact,
|
|
54
|
-
'info-license': InfoLicense,
|
|
55
|
-
'info-license-url': InfoLicenseUrl,
|
|
56
|
-
'info-license-strict': InfoLicenseStrict,
|
|
57
|
-
'tag-description': TagDescription,
|
|
58
|
-
'tags-alphabetical': TagsAlphabetical,
|
|
59
|
-
'paths-kebab-case': PathsKebabCase,
|
|
60
|
-
'no-enum-type-mismatch': NoEnumTypeMismatch,
|
|
61
|
-
'boolean-parameter-prefixes': BooleanParameterPrefixes,
|
|
62
|
-
'no-path-trailing-slash': NoPathTrailingSlash,
|
|
63
|
-
'operation-2xx-response': Operation2xxResponse,
|
|
64
|
-
'operation-4xx-response': Operation4xxResponse,
|
|
65
|
-
assertions: Assertions,
|
|
66
|
-
'operation-operationId-unique': OperationIdUnique,
|
|
67
|
-
'operation-parameters-unique': OperationParametersUnique,
|
|
68
|
-
'path-parameters-defined': PathParamsDefined,
|
|
69
|
-
'operation-tag-defined': OperationTagDefined,
|
|
70
|
-
'path-declaration-must-exist': PathDeclarationMustExist,
|
|
71
|
-
'operation-operationId-url-safe': OperationIdUrlSafe,
|
|
72
|
-
'operation-operationId': OperationOperationId,
|
|
73
|
-
'operation-summary': OperationSummary,
|
|
74
|
-
'operation-description': OperationDescription,
|
|
75
|
-
'path-not-include-query': PathNotIncludeQuery,
|
|
76
|
-
'path-params-defined': PathParamsDefined,
|
|
77
|
-
'parameter-description': ParameterDescription,
|
|
78
|
-
'operation-singular-tag': OperationSingularTag,
|
|
79
|
-
'security-defined': SecurityDefined,
|
|
80
|
-
'no-unresolved-refs': NoUnresolvedRefs,
|
|
81
|
-
'no-identical-paths': NoIdenticalPaths,
|
|
82
|
-
'no-ambiguous-paths': NoAmbiguousPaths,
|
|
83
|
-
'path-http-verbs-order': PathHttpVerbsOrder,
|
|
84
|
-
'no-http-verbs-in-paths': NoHttpVerbsInPaths,
|
|
85
|
-
'path-excludes-patterns': PathExcludesPatterns,
|
|
86
|
-
'request-mime-type': RequestMimeType,
|
|
87
|
-
'response-mime-type': ResponseMimeType,
|
|
88
|
-
'path-segment-plural': PathSegmentPlural,
|
|
89
|
-
'response-contains-header': ResponseContainsHeader,
|
|
90
|
-
'response-contains-property': ResponseContainsProperty,
|
|
91
|
-
'scalar-property-missing-example': ScalarPropertyMissingExample,
|
|
92
|
-
'required-string-property-missing-min-length': RequiredStringPropertyMissingMinLength,
|
|
93
|
-
'spec-strict-refs': SpecStrictRefs,
|
|
94
|
-
'no-required-schema-properties-undefined': NoRequiredSchemaPropertiesUndefined,
|
|
95
|
-
'no-schema-type-mismatch': NoSchemaTypeMismatch,
|
|
52
|
+
spec: struct_1.Struct,
|
|
53
|
+
struct: struct_1.Struct,
|
|
54
|
+
'no-invalid-schema-examples': no_invalid_schema_examples_1.NoInvalidSchemaExamples,
|
|
55
|
+
'no-invalid-parameter-examples': no_invalid_parameter_examples_1.NoInvalidParameterExamples,
|
|
56
|
+
'info-contact': info_contact_1.InfoContact,
|
|
57
|
+
'info-license': info_license_1.InfoLicense,
|
|
58
|
+
'info-license-url': info_license_url_1.InfoLicenseUrl,
|
|
59
|
+
'info-license-strict': info_license_strict_1.InfoLicenseStrict,
|
|
60
|
+
'tag-description': tag_description_1.TagDescription,
|
|
61
|
+
'tags-alphabetical': tags_alphabetical_1.TagsAlphabetical,
|
|
62
|
+
'paths-kebab-case': paths_kebab_case_1.PathsKebabCase,
|
|
63
|
+
'no-enum-type-mismatch': no_enum_type_mismatch_1.NoEnumTypeMismatch,
|
|
64
|
+
'boolean-parameter-prefixes': boolean_parameter_prefixes_1.BooleanParameterPrefixes,
|
|
65
|
+
'no-path-trailing-slash': no_path_trailing_slash_1.NoPathTrailingSlash,
|
|
66
|
+
'operation-2xx-response': operation_2xx_response_1.Operation2xxResponse,
|
|
67
|
+
'operation-4xx-response': operation_4xx_response_1.Operation4xxResponse,
|
|
68
|
+
assertions: assertions_1.Assertions,
|
|
69
|
+
'operation-operationId-unique': operation_operationId_unique_1.OperationIdUnique,
|
|
70
|
+
'operation-parameters-unique': operation_parameters_unique_1.OperationParametersUnique,
|
|
71
|
+
'path-parameters-defined': path_params_defined_1.PathParamsDefined,
|
|
72
|
+
'operation-tag-defined': operation_tag_defined_1.OperationTagDefined,
|
|
73
|
+
'path-declaration-must-exist': path_declaration_must_exist_1.PathDeclarationMustExist,
|
|
74
|
+
'operation-operationId-url-safe': operation_operationId_url_safe_1.OperationIdUrlSafe,
|
|
75
|
+
'operation-operationId': operation_operationId_1.OperationOperationId,
|
|
76
|
+
'operation-summary': operation_summary_1.OperationSummary,
|
|
77
|
+
'operation-description': operation_description_1.OperationDescription,
|
|
78
|
+
'path-not-include-query': path_not_include_query_1.PathNotIncludeQuery,
|
|
79
|
+
'path-params-defined': path_params_defined_1.PathParamsDefined,
|
|
80
|
+
'parameter-description': parameter_description_1.ParameterDescription,
|
|
81
|
+
'operation-singular-tag': operation_singular_tag_1.OperationSingularTag,
|
|
82
|
+
'security-defined': security_defined_1.SecurityDefined,
|
|
83
|
+
'no-unresolved-refs': no_unresolved_refs_1.NoUnresolvedRefs,
|
|
84
|
+
'no-identical-paths': no_identical_paths_1.NoIdenticalPaths,
|
|
85
|
+
'no-ambiguous-paths': no_ambiguous_paths_1.NoAmbiguousPaths,
|
|
86
|
+
'path-http-verbs-order': path_http_verbs_order_1.PathHttpVerbsOrder,
|
|
87
|
+
'no-http-verbs-in-paths': no_http_verbs_in_paths_1.NoHttpVerbsInPaths,
|
|
88
|
+
'path-excludes-patterns': path_excludes_patterns_1.PathExcludesPatterns,
|
|
89
|
+
'request-mime-type': request_mime_type_1.RequestMimeType,
|
|
90
|
+
'response-mime-type': response_mime_type_1.ResponseMimeType,
|
|
91
|
+
'path-segment-plural': path_segment_plural_1.PathSegmentPlural,
|
|
92
|
+
'response-contains-header': response_contains_header_1.ResponseContainsHeader,
|
|
93
|
+
'response-contains-property': response_contains_property_1.ResponseContainsProperty,
|
|
94
|
+
'scalar-property-missing-example': scalar_property_missing_example_1.ScalarPropertyMissingExample,
|
|
95
|
+
'required-string-property-missing-min-length': required_string_property_missing_min_length_1.RequiredStringPropertyMissingMinLength,
|
|
96
|
+
'spec-strict-refs': spec_strict_refs_1.SpecStrictRefs,
|
|
97
|
+
'no-required-schema-properties-undefined': no_required_schema_properties_undefined_1.NoRequiredSchemaPropertiesUndefined,
|
|
98
|
+
'no-schema-type-mismatch': no_schema_type_mismatch_1.NoSchemaTypeMismatch,
|
|
96
99
|
};
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=index.js.map
|
|
100
|
+
exports.preprocessors = {};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequestMimeType = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const RequestMimeType = ({ allowedValues }) => {
|
|
3
6
|
return {
|
|
4
7
|
Root(root, ctx) {
|
|
5
|
-
validateMimeType({ type: 'consumes', value: root }, ctx, allowedValues);
|
|
8
|
+
(0, utils_1.validateMimeType)({ type: 'consumes', value: root }, ctx, allowedValues);
|
|
6
9
|
},
|
|
7
10
|
Operation: {
|
|
8
11
|
leave(operation, ctx) {
|
|
9
|
-
validateMimeType({ type: 'consumes', value: operation }, ctx, allowedValues);
|
|
12
|
+
(0, utils_1.validateMimeType)({ type: 'consumes', value: operation }, ctx, allowedValues);
|
|
10
13
|
},
|
|
11
14
|
},
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
exports.RequestMimeType = RequestMimeType;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResponseContainsProperty = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const ResponseContainsProperty = (options) => {
|
|
3
6
|
const names = options.names || {};
|
|
4
7
|
let key;
|
|
5
8
|
return {
|
|
@@ -15,8 +18,8 @@ export const ResponseContainsProperty = (options) => {
|
|
|
15
18
|
if (schema.type !== 'object')
|
|
16
19
|
return;
|
|
17
20
|
const expectedProperties = names[key] ||
|
|
18
|
-
names[getMatchingStatusCodeRange(key)] ||
|
|
19
|
-
names[getMatchingStatusCodeRange(key).toLowerCase()] ||
|
|
21
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key)] ||
|
|
22
|
+
names[(0, utils_1.getMatchingStatusCodeRange)(key).toLowerCase()] ||
|
|
20
23
|
[];
|
|
21
24
|
for (const expectedProperty of expectedProperties) {
|
|
22
25
|
if (!schema.properties?.[expectedProperty]) {
|
|
@@ -31,4 +34,4 @@ export const ResponseContainsProperty = (options) => {
|
|
|
31
34
|
},
|
|
32
35
|
};
|
|
33
36
|
};
|
|
34
|
-
|
|
37
|
+
exports.ResponseContainsProperty = ResponseContainsProperty;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResponseMimeType = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const ResponseMimeType = ({ allowedValues }) => {
|
|
3
6
|
return {
|
|
4
7
|
Root(root, ctx) {
|
|
5
|
-
validateMimeType({ type: 'produces', value: root }, ctx, allowedValues);
|
|
8
|
+
(0, utils_1.validateMimeType)({ type: 'produces', value: root }, ctx, allowedValues);
|
|
6
9
|
},
|
|
7
10
|
Operation: {
|
|
8
11
|
leave(operation, ctx) {
|
|
9
|
-
validateMimeType({ type: 'produces', value: operation }, ctx, allowedValues);
|
|
12
|
+
(0, utils_1.validateMimeType)({ type: 'produces', value: operation }, ctx, allowedValues);
|
|
10
13
|
},
|
|
11
14
|
},
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
exports.ResponseMimeType = ResponseMimeType;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Oas3Rule } from '../../visitors
|
|
1
|
+
import type { Oas3Rule } from '../../visitors';
|
|
2
2
|
export type ArrayParameterSerializationOptions = {
|
|
3
3
|
in?: string[];
|
|
4
4
|
};
|
|
5
5
|
export declare const ArrayParameterSerialization: Oas3Rule;
|
|
6
|
-
//# sourceMappingURL=array-parameter-serialization.d.ts.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayParameterSerialization = void 0;
|
|
4
|
+
const ref_utils_1 = require("../../ref-utils");
|
|
5
|
+
const ArrayParameterSerialization = (options) => {
|
|
3
6
|
return {
|
|
4
7
|
Parameter: {
|
|
5
8
|
leave(node, ctx) {
|
|
6
9
|
if (!node.schema) {
|
|
7
10
|
return;
|
|
8
11
|
}
|
|
9
|
-
const schema = (isRef(node.schema) ? ctx.resolve(node.schema).node : node.schema);
|
|
12
|
+
const schema = ((0, ref_utils_1.isRef)(node.schema) ? ctx.resolve(node.schema).node : node.schema);
|
|
10
13
|
if (schema &&
|
|
11
14
|
shouldReportMissingStyleAndExplode(node, schema, options)) {
|
|
12
15
|
ctx.report({
|
|
@@ -18,9 +21,9 @@ export const ArrayParameterSerialization = (options) => {
|
|
|
18
21
|
},
|
|
19
22
|
};
|
|
20
23
|
};
|
|
24
|
+
exports.ArrayParameterSerialization = ArrayParameterSerialization;
|
|
21
25
|
function shouldReportMissingStyleAndExplode(node, schema, options) {
|
|
22
26
|
return ((schema.type === 'array' || schema.items || schema.prefixItems) &&
|
|
23
27
|
(node.style === undefined || node.explode === undefined) &&
|
|
24
28
|
(!options.in || (node.in && options.in?.includes(node.in))));
|
|
25
29
|
}
|
|
26
|
-
//# sourceMappingURL=array-parameter-serialization.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Oas3Rule } from '../../visitors
|
|
1
|
+
import type { Oas3Rule } from '../../visitors';
|
|
2
2
|
export type BooleanParameterPrefixesOptions = {
|
|
3
3
|
prefixes?: string[];
|
|
4
4
|
};
|
|
5
5
|
export declare const BooleanParameterPrefixes: Oas3Rule;
|
|
6
|
-
//# sourceMappingURL=boolean-parameter-prefixes.d.ts.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanParameterPrefixes = void 0;
|
|
4
|
+
const BooleanParameterPrefixes = (options) => {
|
|
2
5
|
const prefixes = options.prefixes || ['is', 'has'];
|
|
3
6
|
const regexp = new RegExp(`^(${prefixes.join('|')})[A-Z-_]`);
|
|
4
7
|
const wrappedPrefixes = prefixes.map((p) => `\`${p}\``);
|
|
@@ -18,4 +21,4 @@ export const BooleanParameterPrefixes = (options) => {
|
|
|
18
21
|
},
|
|
19
22
|
};
|
|
20
23
|
};
|
|
21
|
-
|
|
24
|
+
exports.BooleanParameterPrefixes = BooleanParameterPrefixes;
|