@redocly/openapi-core 1.34.4 → 2.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -4
- package/lib/bundle.d.ts +16 -15
- package/lib/bundle.d.ts.map +1 -0
- package/lib/bundle.js +88 -109
- package/lib/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 +11 -3
- 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 +44 -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 +27 -0
- package/lib/config/bundle-extends.js.map +1 -0
- package/lib/config/config-resolvers.d.ts +15 -27
- package/lib/config/config-resolvers.d.ts.map +1 -0
- package/lib/config/config-resolvers.js +259 -373
- package/lib/config/config-resolvers.js.map +1 -0
- package/lib/config/config.d.ts +22 -26
- package/lib/config/config.d.ts.map +1 -0
- package/lib/config/config.js +104 -112
- package/lib/config/config.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 -19
- package/lib/config/load.d.ts.map +1 -0
- package/lib/config/load.js +62 -107
- 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 +11 -3
- 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 +11 -3
- 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 +11 -3
- 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 +6 -4
- package/lib/config/spec.js.map +1 -0
- package/lib/config/types.d.ts +19 -62
- 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 -9
- package/lib/config/utils.d.ts.map +1 -0
- package/lib/config/utils.js +56 -258
- package/lib/config/utils.js.map +1 -0
- package/lib/config/visitors.d.ts +36 -0
- package/lib/config/visitors.d.ts.map +1 -0
- package/lib/config/visitors.js +88 -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 +2 -1
- package/lib/decorators/common/filters/filter-helper.d.ts.map +1 -0
- package/lib/decorators/common/filters/filter-helper.js +9 -12
- 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 +5 -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 +5 -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 +4 -7
- 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 +2 -5
- package/lib/decorators/common/info-override.js.map +1 -0
- package/lib/decorators/common/media-type-examples-override.d.ts +2 -1
- package/lib/decorators/common/media-type-examples-override.d.ts.map +1 -0
- package/lib/decorators/common/media-type-examples-override.js +7 -10
- package/lib/decorators/common/media-type-examples-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 +4 -7
- 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 +11 -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 +4 -7
- package/lib/decorators/common/tag-description-override.js.map +1 -0
- package/lib/decorators/oas2/index.d.ts +2 -2
- package/lib/decorators/oas2/index.d.ts.map +1 -0
- package/lib/decorators/oas2/index.js +16 -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 +4 -7
- package/lib/decorators/oas2/remove-unused-components.js.map +1 -0
- package/lib/decorators/oas3/index.d.ts +2 -2
- package/lib/decorators/oas3/index.d.ts.map +1 -0
- package/lib/decorators/oas3/index.js +18 -22
- package/lib/decorators/oas3/index.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 +5 -8
- package/lib/decorators/oas3/remove-unused-components.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/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/format/codeframes.d.ts +2 -1
- package/lib/format/codeframes.d.ts.map +1 -0
- package/lib/format/codeframes.js +15 -19
- package/lib/format/codeframes.js.map +1 -0
- package/lib/format/format.d.ts +2 -1
- package/lib/format/format.d.ts.map +1 -0
- package/lib/format/format.js +57 -62
- package/lib/format/format.js.map +1 -0
- package/lib/index.d.ts +31 -26
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +25 -98
- package/lib/index.js.map +1 -0
- package/lib/js-yaml/index.d.ts +1 -0
- 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.d.ts +12 -13
- package/lib/lint.d.ts.map +1 -0
- package/lib/lint.js +46 -50
- package/lib/lint.js.map +1 -0
- package/lib/logger.d.ts +2 -1
- package/lib/logger.d.ts.map +1 -0
- package/lib/logger.js +15 -17
- package/lib/logger.js.map +1 -0
- package/lib/oas-types.d.ts +395 -3
- package/lib/oas-types.d.ts.map +1 -0
- package/lib/oas-types.js +28 -32
- package/lib/oas-types.js.map +1 -0
- package/lib/ref-utils.d.ts +5 -2
- package/lib/ref-utils.d.ts.map +1 -0
- package/lib/ref-utils.js +30 -33
- package/lib/ref-utils.js.map +1 -0
- package/lib/resolve.d.ts +7 -9
- package/lib/resolve.d.ts.map +1 -0
- package/lib/resolve.js +40 -47
- package/lib/resolve.js.map +1 -0
- package/lib/rules/ajv.d.ts +4 -3
- package/lib/rules/ajv.d.ts.map +1 -0
- package/lib/rules/ajv.js +7 -10
- 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 +39 -35
- package/lib/rules/arazzo/index.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 +2 -5
- 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 +2 -5
- 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 +2 -5
- 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 +23 -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 +23 -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/common/assertions/asserts.d.ts +3 -3
- package/lib/rules/common/assertions/asserts.d.ts.map +1 -0
- package/lib/rules/common/assertions/asserts.js +35 -51
- package/lib/rules/common/assertions/asserts.js.map +1 -0
- package/lib/rules/common/assertions/index.d.ts +4 -3
- package/lib/rules/common/assertions/index.d.ts.map +1 -0
- package/lib/rules/common/assertions/index.js +7 -10
- package/lib/rules/common/assertions/index.js.map +1 -0
- package/lib/rules/common/assertions/utils.d.ts +5 -4
- package/lib/rules/common/assertions/utils.d.ts.map +1 -0
- package/lib/rules/common/assertions/utils.js +21 -29
- 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 +7 -10
- package/lib/rules/common/info-license-strict.js.map +1 -0
- package/lib/rules/common/info-license-url.d.ts +2 -1
- package/lib/rules/common/info-license-url.d.ts.map +1 -0
- package/lib/rules/common/info-license-url.js +4 -7
- package/lib/rules/common/info-license-url.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 +2 -1
- 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 +5 -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 +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.d.ts.map +1 -0
- package/lib/rules/common/no-invalid-parameter-examples.js +5 -9
- 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 +5 -9
- package/lib/rules/common/no-invalid-schema-examples.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 +2 -1
- package/lib/rules/common/no-required-schema-properties-undefined.d.ts.map +1 -0
- package/lib/rules/common/no-required-schema-properties-undefined.js +6 -8
- package/lib/rules/common/no-required-schema-properties-undefined.js.map +1 -0
- package/lib/rules/common/no-schema-type-mismatch.d.ts +2 -1
- 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/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-excludes-patterns.d.ts +2 -1
- package/lib/rules/common/path-excludes-patterns.d.ts.map +1 -0
- package/lib/rules/common/path-excludes-patterns.js +2 -5
- package/lib/rules/common/path-excludes-patterns.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 +2 -5
- 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 +2 -5
- 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 -8
- 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 +2 -1
- package/lib/rules/common/struct.d.ts.map +1 -0
- package/lib/rules/common/struct.js +19 -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/no-unresolved-refs.d.ts +4 -3
- package/lib/rules/no-unresolved-refs.d.ts.map +1 -0
- package/lib/rules/no-unresolved-refs.js +5 -9
- package/lib/rules/no-unresolved-refs.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 +96 -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 +122 -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 +6 -10
- 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 +2 -5
- 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 +2 -5
- 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/other/stats.d.ts +4 -3
- package/lib/rules/other/stats.d.ts.map +1 -0
- package/lib/rules/other/stats.js +2 -5
- 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 +9 -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 +2 -5
- package/lib/rules/respect/no-criteria-xpath.js.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.d.ts +3 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.d.ts.map +1 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.js +21 -0
- package/lib/rules/respect/no-x-security-scheme-name-in-workflow.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-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 +6 -4
- package/lib/rules/utils.d.ts.map +1 -0
- package/lib/rules/utils.js +23 -43
- 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 +40 -23
- package/lib/types/arazzo.js.map +1 -0
- package/lib/types/asyncapi2.d.ts +2 -1
- package/lib/types/asyncapi2.d.ts.map +1 -0
- package/lib/types/asyncapi2.js +54 -56
- 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 +41 -43
- package/lib/types/asyncapi3.js.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +7 -13
- package/lib/types/index.js.map +1 -0
- package/lib/types/json-schema-adapter.d.ts +2 -1
- package/lib/types/json-schema-adapter.d.ts.map +1 -0
- package/lib/types/json-schema-adapter.js +15 -17
- package/lib/types/json-schema-adapter.js.map +1 -0
- package/lib/types/oas2.d.ts +85 -3
- package/lib/types/oas2.d.ts.map +1 -0
- package/lib/types/oas2.js +17 -19
- package/lib/types/oas2.js.map +1 -0
- package/lib/types/oas3.d.ts +159 -3
- package/lib/types/oas3.d.ts.map +1 -0
- package/lib/types/oas3.js +44 -46
- package/lib/types/oas3.js.map +1 -0
- package/lib/types/oas3_1.d.ts +162 -3
- package/lib/types/oas3_1.d.ts.map +1 -0
- package/lib/types/oas3_1.js +19 -21
- package/lib/types/oas3_1.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 +4 -6
- package/lib/types/overlay.js.map +1 -0
- package/lib/types/redocly-yaml.d.ts +10 -14
- package/lib/types/redocly-yaml.d.ts.map +1 -0
- package/lib/types/redocly-yaml.js +79 -813
- package/lib/types/redocly-yaml.js.map +1 -0
- package/lib/typings/arazzo.d.ts +41 -0
- 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 +1 -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 +1 -0
- 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 +45 -15
- 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/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 +2 -1
- 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/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.d.ts +6 -11
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +50 -123
- package/lib/utils.js.map +1 -0
- package/lib/visitors.d.ts +16 -15
- package/lib/visitors.d.ts.map +1 -0
- package/lib/visitors.js +4 -6
- package/lib/visitors.js.map +1 -0
- package/lib/walk.d.ts +9 -8
- package/lib/walk.d.ts.map +1 -0
- package/lib/walk.js +31 -28
- package/lib/walk.js.map +1 -0
- package/package.json +31 -10
- package/CHANGELOG.md +0 -563
- package/__tests__/utils.ts +0 -92
- 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/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/src/__tests__/__snapshots__/bundle.test.ts.snap +0 -461
- package/src/__tests__/bundle.test.ts +0 -478
- package/src/__tests__/codeframes.test.ts +0 -530
- package/src/__tests__/fixtures/.redocly.lint-ignore.yaml +0 -5
- package/src/__tests__/fixtures/extension.js +0 -24
- package/src/__tests__/fixtures/lint/openapi.yaml +0 -10
- package/src/__tests__/fixtures/redocly.yaml +0 -2
- package/src/__tests__/fixtures/refs/definitions.yaml +0 -3
- package/src/__tests__/fixtures/refs/examples.yaml +0 -8
- package/src/__tests__/fixtures/refs/external-request-body.yaml +0 -13
- package/src/__tests__/fixtures/refs/externalref.yaml +0 -35
- package/src/__tests__/fixtures/refs/hosted.yaml +0 -35
- package/src/__tests__/fixtures/refs/openapi-with-external-refs-conflicting-names.yaml +0 -21
- package/src/__tests__/fixtures/refs/openapi-with-external-refs.yaml +0 -33
- package/src/__tests__/fixtures/refs/openapi-with-special-names-in-props.yaml +0 -19
- package/src/__tests__/fixtures/refs/openapi-with-url-refs.yaml +0 -18
- package/src/__tests__/fixtures/refs/param-b.yaml +0 -1
- package/src/__tests__/fixtures/refs/param-c.yaml +0 -1
- package/src/__tests__/fixtures/refs/rename.yaml +0 -1
- package/src/__tests__/fixtures/refs/requestBody.yaml +0 -9
- package/src/__tests__/fixtures/refs/schema-a.yaml +0 -1
- package/src/__tests__/fixtures/refs/simple.yaml +0 -1
- package/src/__tests__/fixtures/refs/vendor.schema.yaml +0 -20
- package/src/__tests__/fixtures/resolve/External.yaml +0 -10
- package/src/__tests__/fixtures/resolve/External2.yaml +0 -4
- package/src/__tests__/fixtures/resolve/description.md +0 -3
- package/src/__tests__/fixtures/resolve/externalInfo.yaml +0 -4
- package/src/__tests__/fixtures/resolve/externalLicense.yaml +0 -1
- package/src/__tests__/fixtures/resolve/openapi-with-back.yaml +0 -13
- package/src/__tests__/fixtures/resolve/openapi-with-md-description.yaml +0 -5
- package/src/__tests__/fixtures/resolve/openapi.yaml +0 -28
- package/src/__tests__/fixtures/resolve/schemas/type-a.yaml +0 -10
- package/src/__tests__/fixtures/resolve/schemas/type-b.yaml +0 -6
- package/src/__tests__/fixtures/resolve/transitive/a.yaml +0 -1
- package/src/__tests__/fixtures/resolve/transitive/components.yaml +0 -5
- package/src/__tests__/fixtures/resolve/transitive/schemas.yaml +0 -3
- package/src/__tests__/format.test.ts +0 -147
- package/src/__tests__/js-yaml.test.ts +0 -73
- package/src/__tests__/lint.test.ts +0 -1772
- package/src/__tests__/logger-browser.test.ts +0 -53
- package/src/__tests__/logger.test.ts +0 -47
- package/src/__tests__/login.test.ts +0 -17
- package/src/__tests__/normalizeVisitors.test.ts +0 -169
- package/src/__tests__/output-browser.test.ts +0 -18
- package/src/__tests__/output.test.ts +0 -15
- package/src/__tests__/ref-utils.test.ts +0 -142
- package/src/__tests__/resolve-http.test.ts +0 -77
- package/src/__tests__/resolve.test.ts +0 -431
- package/src/__tests__/utils-browser.test.ts +0 -11
- package/src/__tests__/utils.test.ts +0 -144
- package/src/__tests__/walk.test.ts +0 -1596
- package/src/benchmark/benches/lint-with-many-rules.bench.ts +0 -41
- package/src/benchmark/benches/lint-with-nested-rule.bench.ts +0 -45
- package/src/benchmark/benches/lint-with-no-rules.bench.ts +0 -27
- package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +0 -40
- package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +0 -38
- package/src/benchmark/benches/rebilly.yaml +0 -32272
- package/src/benchmark/benches/recommended-oas3.bench.ts +0 -22
- package/src/benchmark/benches/resolve-with-no-external.bench.ts +0 -23
- package/src/benchmark/benchmark.js +0 -311
- package/src/benchmark/colors.js +0 -29
- package/src/benchmark/fork.js +0 -87
- package/src/benchmark/utils.ts +0 -37
- package/src/bundle.ts +0 -531
- package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +0 -485
- package/src/config/__tests__/__snapshots__/config.test.ts.snap +0 -232
- package/src/config/__tests__/config-resolvers.test.ts +0 -668
- package/src/config/__tests__/config.test.ts +0 -356
- package/src/config/__tests__/fixtures/ingore-file.ts +0 -8
- package/src/config/__tests__/fixtures/load-external.yaml +0 -2
- package/src/config/__tests__/fixtures/load-redocly.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin-config.yaml +0 -2
- package/src/config/__tests__/fixtures/plugin.js +0 -56
- package/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml +0 -11
- package/src/config/__tests__/fixtures/resolve-config/api/plugin.js +0 -69
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml +0 -7
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-commonjs-export-function.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-custom-function.yaml +0 -17
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-esm.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml +0 -18
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-plugin-init.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-realm-plugin.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-config/local-config-with-wrong-custom-function.yaml +0 -15
- package/src/config/__tests__/fixtures/resolve-config/local-config.yaml +0 -9
- package/src/config/__tests__/fixtures/resolve-config/plugin-esm.mjs +0 -10
- package/src/config/__tests__/fixtures/resolve-config/plugin-with-export-function.cjs +0 -10
- package/src/config/__tests__/fixtures/resolve-config/plugin-with-init-logic.js +0 -9
- package/src/config/__tests__/fixtures/resolve-config/plugin.js +0 -80
- package/src/config/__tests__/fixtures/resolve-config/realm-plugin.js +0 -12
- package/src/config/__tests__/fixtures/resolve-refs-in-config/config-with-refs.yaml +0 -8
- package/src/config/__tests__/fixtures/resolve-refs-in-config/rules.yaml +0 -2
- package/src/config/__tests__/fixtures/resolve-refs-in-config/seo.yaml +0 -1
- package/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml +0 -3
- package/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml +0 -4
- package/src/config/__tests__/load.test.ts +0 -320
- package/src/config/__tests__/resolve-plugins.test.ts +0 -30
- package/src/config/__tests__/utils.test.ts +0 -225
- package/src/config/all.ts +0 -234
- package/src/config/builtIn.ts +0 -59
- package/src/config/config-resolvers.ts +0 -657
- package/src/config/config.ts +0 -423
- package/src/config/index.ts +0 -7
- package/src/config/load.ts +0 -213
- package/src/config/minimal.ts +0 -210
- package/src/config/recommended-strict.ts +0 -210
- package/src/config/recommended.ts +0 -210
- package/src/config/rules.ts +0 -72
- package/src/config/spec.ts +0 -33
- package/src/config/types.ts +0 -306
- package/src/config/utils.ts +0 -439
- package/src/decorators/__tests__/filter-in.test.ts +0 -313
- package/src/decorators/__tests__/filter-out.test.ts +0 -344
- package/src/decorators/__tests__/media-type-examples-override.test.ts +0 -665
- package/src/decorators/__tests__/remove-x-internal.test.ts +0 -416
- package/src/decorators/__tests__/resources/request.yaml +0 -3
- package/src/decorators/__tests__/resources/response.yaml +0 -3
- package/src/decorators/arazzo/index.ts +0 -1
- package/src/decorators/async2/index.ts +0 -1
- package/src/decorators/async3/index.ts +0 -1
- package/src/decorators/common/filters/filter-helper.ts +0 -73
- package/src/decorators/common/filters/filter-in.ts +0 -19
- package/src/decorators/common/filters/filter-out.ts +0 -19
- package/src/decorators/common/info-description-override.ts +0 -25
- package/src/decorators/common/info-override.ts +0 -15
- package/src/decorators/common/media-type-examples-override.ts +0 -80
- package/src/decorators/common/operation-description-override.ts +0 -31
- package/src/decorators/common/registry-dependencies.ts +0 -25
- package/src/decorators/common/remove-x-internal.ts +0 -77
- package/src/decorators/common/tag-description-override.ts +0 -26
- package/src/decorators/oas2/__tests__/remove-unused-components.test.ts +0 -228
- package/src/decorators/oas2/index.ts +0 -21
- package/src/decorators/oas2/remove-unused-components.ts +0 -109
- package/src/decorators/oas3/__tests__/remove-unused-components.test.ts +0 -313
- package/src/decorators/oas3/index.ts +0 -23
- package/src/decorators/oas3/remove-unused-components.ts +0 -138
- package/src/decorators/overlay1/index.ts +0 -1
- package/src/env.ts +0 -5
- package/src/format/codeframes.ts +0 -217
- package/src/format/format.ts +0 -479
- package/src/index.ts +0 -91
- package/src/js-yaml/index.ts +0 -16
- package/src/lint.ts +0 -190
- package/src/logger.ts +0 -36
- package/src/oas-types.ts +0 -178
- package/src/output.ts +0 -7
- package/src/redocly/__tests__/domains.test.ts +0 -52
- package/src/redocly/__tests__/redocly-client.test.ts +0 -156
- package/src/redocly/domains.ts +0 -48
- package/src/redocly/index.ts +0 -177
- package/src/redocly/redocly-client-types.ts +0 -10
- package/src/redocly/registry-api-types.ts +0 -32
- package/src/redocly/registry-api.ts +0 -147
- package/src/ref-utils.ts +0 -91
- package/src/resolve.ts +0 -461
- package/src/rules/__tests__/fixtures/code-sample.php +0 -9
- package/src/rules/__tests__/fixtures/invalid-yaml.yaml +0 -1
- package/src/rules/__tests__/fixtures/ref.yaml +0 -1
- package/src/rules/__tests__/no-unresolved-refs.test.ts +0 -271
- package/src/rules/__tests__/utils.test.ts +0 -160
- package/src/rules/ajv.ts +0 -105
- package/src/rules/arazzo/__tests__/criteria-unique.test.ts +0 -160
- package/src/rules/arazzo/__tests__/no-criteria-xpath.test.ts +0 -126
- package/src/rules/arazzo/__tests__/parameters-unique.test.ts +0 -113
- package/src/rules/arazzo/__tests__/requestBody-replacements-unique.test.ts +0 -108
- package/src/rules/arazzo/__tests__/respect-supported-versions.test.ts +0 -116
- package/src/rules/arazzo/__tests__/source-description-type.test.ts +0 -78
- package/src/rules/arazzo/__tests__/sourceDescription-name-unique.test.ts +0 -78
- package/src/rules/arazzo/__tests__/sourceDescriptions-not-empty.test.ts +0 -104
- package/src/rules/arazzo/__tests__/step-onFailure-unique.test.ts +0 -110
- package/src/rules/arazzo/__tests__/step-onSuccess-unique.test.ts +0 -110
- package/src/rules/arazzo/__tests__/stepId-unique.test.ts +0 -94
- package/src/rules/arazzo/__tests__/workflow-dependsOn.test.ts +0 -209
- package/src/rules/arazzo/__tests__/workflowId-unique.test.ts +0 -88
- package/src/rules/arazzo/criteria-unique.ts +0 -70
- package/src/rules/arazzo/index.ts +0 -38
- package/src/rules/arazzo/parameters-unique.ts +0 -33
- package/src/rules/arazzo/requestBody-replacements-unique.ts +0 -33
- package/src/rules/arazzo/sourceDescription-type.ts +0 -21
- package/src/rules/arazzo/sourceDescriptions-name-unique.ts +0 -23
- package/src/rules/arazzo/sourceDescriptions-not-empty.ts +0 -17
- package/src/rules/arazzo/step-onFailure-unique.ts +0 -33
- package/src/rules/arazzo/step-onSuccess-unique.ts +0 -33
- package/src/rules/arazzo/stepId-unique.ts +0 -24
- package/src/rules/arazzo/workflow-dependsOn.ts +0 -56
- package/src/rules/arazzo/workflowId-unique.ts +0 -21
- package/src/rules/async2/__tests__/channels-kebab-case.test.ts +0 -145
- package/src/rules/async2/__tests__/no-channel-trailing-slash.test.ts +0 -97
- package/src/rules/async2/channels-kebab-case.ts +0 -18
- package/src/rules/async2/index.ts +0 -29
- package/src/rules/async2/no-channel-trailing-slash.ts +0 -15
- package/src/rules/async3/__tests__/channels-kebab-case.test.ts +0 -145
- package/src/rules/async3/__tests__/no-channel-trailing-slash.test.ts +0 -96
- package/src/rules/async3/channels-kebab-case.ts +0 -19
- package/src/rules/async3/index.ts +0 -29
- package/src/rules/async3/no-channel-trailing-slash.ts +0 -16
- package/src/rules/common/__tests__/info-license-strict.test.ts +0 -141
- package/src/rules/common/__tests__/info-license.test.ts +0 -62
- package/src/rules/common/__tests__/license-url.test.ts +0 -63
- package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +0 -96
- package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +0 -210
- package/src/rules/common/__tests__/no-identical-paths.test.ts +0 -58
- package/src/rules/common/__tests__/no-invalid-parameter-examples.test.ts +0 -53
- package/src/rules/common/__tests__/no-invalid-schema-examples.test.ts +0 -86
- package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +0 -126
- package/src/rules/common/__tests__/no-required-schema-properties-undefined.test.ts +0 -550
- package/src/rules/common/__tests__/no-schema-type-mismatch.test.ts +0 -126
- package/src/rules/common/__tests__/operation-2xx-response.test.ts +0 -194
- package/src/rules/common/__tests__/operation-4xx-response.test.ts +0 -233
- package/src/rules/common/__tests__/operation-operationId-unique.test.ts +0 -76
- package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +0 -45
- package/src/rules/common/__tests__/operation-parameters-unique.test.ts +0 -167
- package/src/rules/common/__tests__/operation-singular-tag.test.ts +0 -72
- package/src/rules/common/__tests__/operation-tag-defined.test.ts +0 -68
- package/src/rules/common/__tests__/path-http-verbs-order.test.ts +0 -95
- package/src/rules/common/__tests__/path-not-include-query.test.ts +0 -64
- package/src/rules/common/__tests__/path-params-defined.test.ts +0 -202
- package/src/rules/common/__tests__/paths-kebab-case.test.ts +0 -110
- package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +0 -264
- package/src/rules/common/__tests__/security-defined.test.ts +0 -284
- package/src/rules/common/__tests__/spec-strict-refs.test.ts +0 -69
- package/src/rules/common/__tests__/struct.test.ts +0 -657
- package/src/rules/common/__tests__/tag-description.test.ts +0 -65
- package/src/rules/common/__tests__/tags-alphabetical.test.ts +0 -124
- package/src/rules/common/assertions/__tests__/asserts.test.ts +0 -877
- package/src/rules/common/assertions/__tests__/index.test.ts +0 -100
- package/src/rules/common/assertions/__tests__/utils.test.ts +0 -236
- package/src/rules/common/assertions/asserts.ts +0 -365
- package/src/rules/common/assertions/index.ts +0 -68
- package/src/rules/common/assertions/utils.ts +0 -333
- package/src/rules/common/info-contact.ts +0 -16
- package/src/rules/common/info-license-strict.ts +0 -24
- package/src/rules/common/info-license-url.ts +0 -11
- package/src/rules/common/info-license.ts +0 -16
- package/src/rules/common/no-ambiguous-paths.ts +0 -50
- package/src/rules/common/no-enum-type-mismatch.ts +0 -53
- package/src/rules/common/no-http-verbs-in-paths.ts +0 -37
- package/src/rules/common/no-identical-paths.ts +0 -24
- package/src/rules/common/no-invalid-parameter-examples.ts +0 -37
- package/src/rules/common/no-invalid-schema-examples.ts +0 -40
- package/src/rules/common/no-path-trailing-slash.ts +0 -15
- package/src/rules/common/no-required-schema-properties-undefined.ts +0 -54
- package/src/rules/common/no-schema-type-mismatch.ts +0 -24
- package/src/rules/common/operation-2xx-response.ts +0 -25
- package/src/rules/common/operation-4xx-response.ts +0 -25
- package/src/rules/common/operation-description.ts +0 -14
- package/src/rules/common/operation-operationId-unique.ts +0 -21
- package/src/rules/common/operation-operationId-url-safe.ts +0 -20
- package/src/rules/common/operation-operationId.ts +0 -18
- package/src/rules/common/operation-parameters-unique.ts +0 -48
- package/src/rules/common/operation-singular-tag.ts +0 -17
- package/src/rules/common/operation-summary.ts +0 -14
- package/src/rules/common/operation-tag-defined.ts +0 -31
- package/src/rules/common/parameter-description.ts +0 -22
- package/src/rules/common/path-declaration-must-exist.ts +0 -15
- package/src/rules/common/path-excludes-patterns.ts +0 -23
- package/src/rules/common/path-http-verbs-order.ts +0 -30
- package/src/rules/common/path-not-include-query.ts +0 -17
- package/src/rules/common/path-params-defined.ts +0 -65
- package/src/rules/common/path-segment-plural.ts +0 -33
- package/src/rules/common/paths-kebab-case.ts +0 -19
- package/src/rules/common/required-string-property-missing-min-length.ts +0 -44
- package/src/rules/common/response-contains-header.ts +0 -36
- package/src/rules/common/scalar-property-missing-example.ts +0 -59
- package/src/rules/common/security-defined.ts +0 -89
- package/src/rules/common/spec-strict-refs.ts +0 -31
- package/src/rules/common/struct.ts +0 -189
- package/src/rules/common/tag-description.ts +0 -11
- package/src/rules/common/tags-alphabetical.ts +0 -27
- package/src/rules/no-unresolved-refs.ts +0 -52
- package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +0 -112
- package/src/rules/oas2/__tests__/response-contains-header.test.ts +0 -180
- package/src/rules/oas2/__tests__/response-contains-property.test.ts +0 -161
- package/src/rules/oas2/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas2/__tests__/spec/info.test.ts +0 -355
- package/src/rules/oas2/__tests__/spec/operation.test.ts +0 -123
- package/src/rules/oas2/__tests__/spec/paths.test.ts +0 -245
- package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +0 -37
- package/src/rules/oas2/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas2/boolean-parameter-prefixes.ts +0 -26
- package/src/rules/oas2/index.ts +0 -102
- package/src/rules/oas2/request-mime-type.ts +0 -17
- package/src/rules/oas2/response-contains-property.ts +0 -37
- package/src/rules/oas2/response-mime-type.ts +0 -17
- package/src/rules/oas3/__tests__/array-parameter-serialization.test.ts +0 -275
- package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +0 -113
- package/src/rules/oas3/__tests__/component-name-unique.test.ts +0 -966
- package/src/rules/oas3/__tests__/fixtures/common.yaml +0 -11
- package/src/rules/oas3/__tests__/fixtures/external-value.yaml +0 -2
- package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +0 -205
- package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +0 -65
- package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +0 -732
- package/src/rules/oas3/__tests__/no-server-example.com.test.ts +0 -95
- package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +0 -79
- package/src/rules/oas3/__tests__/no-unused-components.test.ts +0 -131
- package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +0 -145
- package/src/rules/oas3/__tests__/response-contains-header.test.ts +0 -401
- package/src/rules/oas3/__tests__/response-contains-property.test.ts +0 -417
- package/src/rules/oas3/__tests__/spec/callbacks.test.ts +0 -41
- package/src/rules/oas3/__tests__/spec/fixtures/description.md +0 -1
- package/src/rules/oas3/__tests__/spec/info.test.ts +0 -391
- package/src/rules/oas3/__tests__/spec/operation.test.ts +0 -253
- package/src/rules/oas3/__tests__/spec/paths.test.ts +0 -284
- package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +0 -77
- package/src/rules/oas3/__tests__/spec/servers.test.ts +0 -505
- package/src/rules/oas3/__tests__/spec/spec.test.ts +0 -307
- package/src/rules/oas3/__tests__/spec/utils.ts +0 -32
- package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +0 -282
- package/src/rules/oas3/__tests__/utils/lint-document-for-test.ts +0 -23
- package/src/rules/oas3/array-parameter-serialization.ts +0 -47
- package/src/rules/oas3/boolean-parameter-prefixes.ts +0 -28
- package/src/rules/oas3/component-name-unique.ts +0 -162
- package/src/rules/oas3/index.ts +0 -126
- package/src/rules/oas3/no-empty-servers.ts +0 -22
- package/src/rules/oas3/no-example-value-and-externalValue.ts +0 -14
- package/src/rules/oas3/no-invalid-media-type-examples.ts +0 -54
- package/src/rules/oas3/no-server-example.com.ts +0 -16
- package/src/rules/oas3/no-server-trailing-slash.ts +0 -15
- package/src/rules/oas3/no-server-variables-empty-enum.ts +0 -66
- package/src/rules/oas3/no-undefined-server-variable.ts +0 -30
- package/src/rules/oas3/no-unused-components.ts +0 -75
- package/src/rules/oas3/operation-4xx-problem-details-rfc7807.ts +0 -36
- package/src/rules/oas3/request-mime-type.ts +0 -31
- package/src/rules/oas3/response-contains-property.ts +0 -39
- package/src/rules/oas3/response-mime-type.ts +0 -31
- package/src/rules/oas3/spec-components-invalid-map-name.ts +0 -69
- package/src/rules/other/stats.ts +0 -75
- package/src/rules/overlay1/__tests__/info-contact.test.ts +0 -112
- package/src/rules/overlay1/index.ts +0 -14
- package/src/rules/respect/no-criteria-xpath.ts +0 -20
- package/src/rules/respect/respect-supported-versions.ts +0 -24
- package/src/rules/utils.ts +0 -230
- package/src/types/arazzo.ts +0 -305
- package/src/types/asyncapi2.ts +0 -1121
- package/src/types/asyncapi3.ts +0 -383
- package/src/types/index.ts +0 -144
- package/src/types/json-schema-adapter.ts +0 -217
- package/src/types/oas2.ts +0 -481
- package/src/types/oas3.ts +0 -594
- package/src/types/oas3_1.ts +0 -290
- package/src/types/overlay.ts +0 -40
- package/src/types/redocly-yaml.ts +0 -1226
- package/src/typings/arazzo.ts +0 -172
- package/src/typings/asyncapi.ts +0 -26
- package/src/typings/asyncapi3.ts +0 -61
- package/src/typings/common.ts +0 -18
- package/src/typings/openapi.ts +0 -347
- package/src/typings/overlay.ts +0 -19
- package/src/typings/swagger.ts +0 -236
- package/src/utils.ts +0 -357
- package/src/visitors.ts +0 -598
- package/src/walk.ts +0 -467
- package/tsconfig.json +0 -8
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,1226 +0,0 @@
|
|
|
1
|
-
import { rootRedoclyConfigSchema } from '@redocly/config';
|
|
2
|
-
import { listOf } from '.';
|
|
3
|
-
import { SpecVersion, getTypes } from '../oas-types';
|
|
4
|
-
import { isCustomRuleId, omitObjectProps, pickObjectProps } from '../utils';
|
|
5
|
-
import { getNodeTypesFromJSONSchema } from './json-schema-adapter';
|
|
6
|
-
import { normalizeTypes } from '../types';
|
|
7
|
-
|
|
8
|
-
import type { JSONSchema } from 'json-schema-to-ts';
|
|
9
|
-
import type { NodeType } from '.';
|
|
10
|
-
import type { Config } from '../config';
|
|
11
|
-
|
|
12
|
-
const builtInOAS2Rules = [
|
|
13
|
-
'info-contact',
|
|
14
|
-
'operation-operationId',
|
|
15
|
-
'tag-description',
|
|
16
|
-
'tags-alphabetical',
|
|
17
|
-
'info-license-url',
|
|
18
|
-
'info-license-strict',
|
|
19
|
-
'info-license',
|
|
20
|
-
'no-ambiguous-paths',
|
|
21
|
-
'no-enum-type-mismatch',
|
|
22
|
-
'no-http-verbs-in-paths',
|
|
23
|
-
'no-identical-paths',
|
|
24
|
-
'no-invalid-parameter-examples',
|
|
25
|
-
'no-invalid-schema-examples',
|
|
26
|
-
'no-path-trailing-slash',
|
|
27
|
-
'operation-2xx-response',
|
|
28
|
-
'operation-4xx-response',
|
|
29
|
-
'operation-description',
|
|
30
|
-
'operation-operationId-unique',
|
|
31
|
-
'operation-operationId-url-safe',
|
|
32
|
-
'operation-parameters-unique',
|
|
33
|
-
'operation-singular-tag',
|
|
34
|
-
'operation-summary',
|
|
35
|
-
'operation-tag-defined',
|
|
36
|
-
'parameter-description',
|
|
37
|
-
'path-declaration-must-exist',
|
|
38
|
-
'path-excludes-patterns',
|
|
39
|
-
'path-http-verbs-order',
|
|
40
|
-
'path-not-include-query',
|
|
41
|
-
'path-params-defined',
|
|
42
|
-
'path-parameters-defined',
|
|
43
|
-
'path-segment-plural',
|
|
44
|
-
'paths-kebab-case',
|
|
45
|
-
'required-string-property-missing-min-length',
|
|
46
|
-
'response-contains-header',
|
|
47
|
-
'scalar-property-missing-example',
|
|
48
|
-
'security-defined',
|
|
49
|
-
'spec-strict-refs',
|
|
50
|
-
'no-unresolved-refs',
|
|
51
|
-
'no-required-schema-properties-undefined',
|
|
52
|
-
'no-schema-type-mismatch',
|
|
53
|
-
'boolean-parameter-prefixes',
|
|
54
|
-
'request-mime-type',
|
|
55
|
-
'response-contains-property',
|
|
56
|
-
'response-mime-type',
|
|
57
|
-
] as const;
|
|
58
|
-
|
|
59
|
-
export type BuiltInOAS2RuleId = typeof builtInOAS2Rules[number];
|
|
60
|
-
|
|
61
|
-
const builtInOAS3Rules = [
|
|
62
|
-
'info-contact',
|
|
63
|
-
'operation-operationId',
|
|
64
|
-
'tag-description',
|
|
65
|
-
'tags-alphabetical',
|
|
66
|
-
'info-license-url',
|
|
67
|
-
'info-license-strict',
|
|
68
|
-
'info-license',
|
|
69
|
-
'no-ambiguous-paths',
|
|
70
|
-
'no-enum-type-mismatch',
|
|
71
|
-
'no-http-verbs-in-paths',
|
|
72
|
-
'no-identical-paths',
|
|
73
|
-
'no-invalid-parameter-examples',
|
|
74
|
-
'no-invalid-schema-examples',
|
|
75
|
-
'no-path-trailing-slash',
|
|
76
|
-
'operation-2xx-response',
|
|
77
|
-
'operation-4xx-response',
|
|
78
|
-
'operation-description',
|
|
79
|
-
'operation-operationId-unique',
|
|
80
|
-
'operation-operationId-url-safe',
|
|
81
|
-
'operation-parameters-unique',
|
|
82
|
-
'operation-singular-tag',
|
|
83
|
-
'operation-summary',
|
|
84
|
-
'operation-tag-defined',
|
|
85
|
-
'parameter-description',
|
|
86
|
-
'path-declaration-must-exist',
|
|
87
|
-
'path-excludes-patterns',
|
|
88
|
-
'path-http-verbs-order',
|
|
89
|
-
'path-not-include-query',
|
|
90
|
-
'path-params-defined',
|
|
91
|
-
'path-parameters-defined',
|
|
92
|
-
'path-segment-plural',
|
|
93
|
-
'paths-kebab-case',
|
|
94
|
-
'required-string-property-missing-min-length',
|
|
95
|
-
'response-contains-header',
|
|
96
|
-
'scalar-property-missing-example',
|
|
97
|
-
'security-defined',
|
|
98
|
-
'spec-strict-refs',
|
|
99
|
-
'no-unresolved-refs',
|
|
100
|
-
'no-required-schema-properties-undefined',
|
|
101
|
-
'no-schema-type-mismatch',
|
|
102
|
-
'boolean-parameter-prefixes',
|
|
103
|
-
'component-name-unique',
|
|
104
|
-
'no-empty-servers',
|
|
105
|
-
'no-example-value-and-externalValue',
|
|
106
|
-
'no-invalid-media-type-examples',
|
|
107
|
-
'no-server-example.com',
|
|
108
|
-
'no-server-trailing-slash',
|
|
109
|
-
'no-server-variables-empty-enum',
|
|
110
|
-
'no-undefined-server-variable',
|
|
111
|
-
'no-unused-components',
|
|
112
|
-
'operation-4xx-problem-details-rfc7807',
|
|
113
|
-
'request-mime-type',
|
|
114
|
-
'response-contains-property',
|
|
115
|
-
'response-mime-type',
|
|
116
|
-
'spec-components-invalid-map-name',
|
|
117
|
-
'array-parameter-serialization',
|
|
118
|
-
] as const;
|
|
119
|
-
|
|
120
|
-
export type BuiltInOAS3RuleId = typeof builtInOAS3Rules[number];
|
|
121
|
-
|
|
122
|
-
const builtInAsync2Rules = [
|
|
123
|
-
'info-contact',
|
|
124
|
-
'info-license-strict',
|
|
125
|
-
'operation-operationId',
|
|
126
|
-
'tag-description',
|
|
127
|
-
'tags-alphabetical',
|
|
128
|
-
'channels-kebab-case',
|
|
129
|
-
'no-channel-trailing-slash',
|
|
130
|
-
] as const;
|
|
131
|
-
|
|
132
|
-
const builtInAsync3Rules = [
|
|
133
|
-
'info-contact',
|
|
134
|
-
'info-license-strict',
|
|
135
|
-
'operation-operationId',
|
|
136
|
-
'tag-description',
|
|
137
|
-
'tags-alphabetical',
|
|
138
|
-
'channels-kebab-case',
|
|
139
|
-
'no-channel-trailing-slash',
|
|
140
|
-
] as const;
|
|
141
|
-
|
|
142
|
-
export type BuiltInAsync2RuleId = typeof builtInAsync2Rules[number];
|
|
143
|
-
|
|
144
|
-
export type BuiltInAsync3RuleId = typeof builtInAsync3Rules[number];
|
|
145
|
-
|
|
146
|
-
const builtInArazzo1Rules = [
|
|
147
|
-
'sourceDescription-type',
|
|
148
|
-
'workflowId-unique',
|
|
149
|
-
'stepId-unique',
|
|
150
|
-
'sourceDescription-name-unique',
|
|
151
|
-
'sourceDescriptions-not-empty',
|
|
152
|
-
'workflow-dependsOn',
|
|
153
|
-
'parameters-unique',
|
|
154
|
-
'step-onSuccess-unique',
|
|
155
|
-
'step-onFailure-unique',
|
|
156
|
-
'respect-supported-versions',
|
|
157
|
-
'requestBody-replacements-unique',
|
|
158
|
-
'no-criteria-xpath',
|
|
159
|
-
'criteria-unique',
|
|
160
|
-
] as const;
|
|
161
|
-
|
|
162
|
-
export type BuiltInArazzo1RuleId = typeof builtInArazzo1Rules[number];
|
|
163
|
-
|
|
164
|
-
const builtInOverlay1Rules = ['info-contact'] as const;
|
|
165
|
-
|
|
166
|
-
export type BuiltInOverlay1RuleId = typeof builtInOverlay1Rules[number];
|
|
167
|
-
|
|
168
|
-
const builtInRules = [
|
|
169
|
-
...builtInOAS2Rules,
|
|
170
|
-
...builtInOAS3Rules,
|
|
171
|
-
...builtInAsync2Rules,
|
|
172
|
-
...builtInAsync3Rules,
|
|
173
|
-
...builtInArazzo1Rules,
|
|
174
|
-
...builtInOverlay1Rules,
|
|
175
|
-
'spec', // TODO: depricated in favor of struct
|
|
176
|
-
'struct',
|
|
177
|
-
] as const;
|
|
178
|
-
|
|
179
|
-
type BuiltInRuleId = typeof builtInRules[number];
|
|
180
|
-
|
|
181
|
-
const oas2NodeTypesList = [
|
|
182
|
-
'Root',
|
|
183
|
-
'Tag',
|
|
184
|
-
'TagList',
|
|
185
|
-
'ExternalDocs',
|
|
186
|
-
'SecurityRequirement',
|
|
187
|
-
'SecurityRequirementList',
|
|
188
|
-
'Info',
|
|
189
|
-
'Contact',
|
|
190
|
-
'License',
|
|
191
|
-
'Paths',
|
|
192
|
-
'PathItem',
|
|
193
|
-
'Parameter',
|
|
194
|
-
'ParameterList',
|
|
195
|
-
'ParameterItems',
|
|
196
|
-
'Operation',
|
|
197
|
-
'Example',
|
|
198
|
-
'ExamplesMap',
|
|
199
|
-
'Examples',
|
|
200
|
-
'Header',
|
|
201
|
-
'Responses',
|
|
202
|
-
'Response',
|
|
203
|
-
'Schema',
|
|
204
|
-
'Xml',
|
|
205
|
-
'SchemaProperties',
|
|
206
|
-
'NamedSchemas',
|
|
207
|
-
'NamedResponses',
|
|
208
|
-
'NamedParameters',
|
|
209
|
-
'NamedSecuritySchemes',
|
|
210
|
-
'SecurityScheme',
|
|
211
|
-
'TagGroup',
|
|
212
|
-
'TagGroups',
|
|
213
|
-
'EnumDescriptions',
|
|
214
|
-
'Logo',
|
|
215
|
-
'XCodeSample',
|
|
216
|
-
'XCodeSampleList',
|
|
217
|
-
'XServer',
|
|
218
|
-
'XServerList',
|
|
219
|
-
] as const;
|
|
220
|
-
|
|
221
|
-
export type Oas2NodeType = typeof oas2NodeTypesList[number];
|
|
222
|
-
|
|
223
|
-
const oas3NodeTypesList = [
|
|
224
|
-
'Root',
|
|
225
|
-
'Tag',
|
|
226
|
-
'TagList',
|
|
227
|
-
'ExternalDocs',
|
|
228
|
-
'Server',
|
|
229
|
-
'ServerList',
|
|
230
|
-
'ServerVariable',
|
|
231
|
-
'ServerVariablesMap',
|
|
232
|
-
'SecurityRequirement',
|
|
233
|
-
'SecurityRequirementList',
|
|
234
|
-
'Info',
|
|
235
|
-
'Contact',
|
|
236
|
-
'License',
|
|
237
|
-
'Paths',
|
|
238
|
-
'PathItem',
|
|
239
|
-
'Parameter',
|
|
240
|
-
'ParameterList',
|
|
241
|
-
'Operation',
|
|
242
|
-
'Callback',
|
|
243
|
-
'CallbacksMap',
|
|
244
|
-
'RequestBody',
|
|
245
|
-
'MediaTypesMap',
|
|
246
|
-
'MediaType',
|
|
247
|
-
'Example',
|
|
248
|
-
'ExamplesMap',
|
|
249
|
-
'Encoding',
|
|
250
|
-
'EncodingMap',
|
|
251
|
-
'Header',
|
|
252
|
-
'HeadersMap',
|
|
253
|
-
'Responses',
|
|
254
|
-
'Response',
|
|
255
|
-
'Link',
|
|
256
|
-
'LinksMap',
|
|
257
|
-
'Schema',
|
|
258
|
-
'Xml',
|
|
259
|
-
'SchemaProperties',
|
|
260
|
-
'DiscriminatorMapping',
|
|
261
|
-
'Discriminator',
|
|
262
|
-
'Components',
|
|
263
|
-
'NamedSchemas',
|
|
264
|
-
'NamedResponses',
|
|
265
|
-
'NamedParameters',
|
|
266
|
-
'NamedExamples',
|
|
267
|
-
'NamedRequestBodies',
|
|
268
|
-
'NamedHeaders',
|
|
269
|
-
'NamedSecuritySchemes',
|
|
270
|
-
'NamedLinks',
|
|
271
|
-
'NamedCallbacks',
|
|
272
|
-
'ImplicitFlow',
|
|
273
|
-
'PasswordFlow',
|
|
274
|
-
'ClientCredentials',
|
|
275
|
-
'AuthorizationCode',
|
|
276
|
-
'OAuth2Flows',
|
|
277
|
-
'SecurityScheme',
|
|
278
|
-
'TagGroup',
|
|
279
|
-
'TagGroups',
|
|
280
|
-
'EnumDescriptions',
|
|
281
|
-
'Logo',
|
|
282
|
-
'XCodeSample',
|
|
283
|
-
'XCodeSampleList',
|
|
284
|
-
'XUsePkce',
|
|
285
|
-
'WebhooksMap',
|
|
286
|
-
] as const;
|
|
287
|
-
|
|
288
|
-
export type Oas3NodeType = typeof oas3NodeTypesList[number];
|
|
289
|
-
|
|
290
|
-
const oas3_1NodeTypesList = [
|
|
291
|
-
'Root',
|
|
292
|
-
'Schema',
|
|
293
|
-
'SchemaProperties',
|
|
294
|
-
'PatternProperties',
|
|
295
|
-
'Info',
|
|
296
|
-
'License',
|
|
297
|
-
'Components',
|
|
298
|
-
'NamedPathItems',
|
|
299
|
-
'SecurityScheme',
|
|
300
|
-
'Operation',
|
|
301
|
-
'DependentRequired',
|
|
302
|
-
] as const;
|
|
303
|
-
|
|
304
|
-
export type Oas3_1NodeType = typeof oas3_1NodeTypesList[number];
|
|
305
|
-
|
|
306
|
-
const ConfigStyleguide: NodeType = {
|
|
307
|
-
properties: {
|
|
308
|
-
extends: {
|
|
309
|
-
type: 'array',
|
|
310
|
-
items: {
|
|
311
|
-
type: 'string',
|
|
312
|
-
},
|
|
313
|
-
},
|
|
314
|
-
rules: 'Rules',
|
|
315
|
-
oas2Rules: 'Rules',
|
|
316
|
-
oas3_0Rules: 'Rules',
|
|
317
|
-
oas3_1Rules: 'Rules',
|
|
318
|
-
async2Rules: 'Rules',
|
|
319
|
-
arazzo1Rules: 'Rules',
|
|
320
|
-
preprocessors: { type: 'object' },
|
|
321
|
-
oas2Preprocessors: { type: 'object' },
|
|
322
|
-
oas3_0Preprocessors: { type: 'object' },
|
|
323
|
-
oas3_1Preprocessors: { type: 'object' },
|
|
324
|
-
async2Preprocessors: { type: 'object' },
|
|
325
|
-
arazzoPreprocessors: { type: 'object' },
|
|
326
|
-
decorators: { type: 'object' },
|
|
327
|
-
oas2Decorators: { type: 'object' },
|
|
328
|
-
oas3_0Decorators: { type: 'object' },
|
|
329
|
-
oas3_1Decorators: { type: 'object' },
|
|
330
|
-
async2Decorators: { type: 'object' },
|
|
331
|
-
arazzo1Decorators: { type: 'object' },
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
const createConfigRoot = (nodeTypes: Record<string, NodeType>): NodeType => ({
|
|
336
|
-
...nodeTypes.rootRedoclyConfigSchema,
|
|
337
|
-
properties: {
|
|
338
|
-
...nodeTypes.rootRedoclyConfigSchema.properties,
|
|
339
|
-
...ConfigStyleguide.properties,
|
|
340
|
-
apis: 'ConfigApis', // Override apis with internal format
|
|
341
|
-
'features.openapi': 'ConfigReferenceDocs', // deprecated
|
|
342
|
-
'features.mockServer': 'ConfigMockServer', // deprecated
|
|
343
|
-
organization: { type: 'string' },
|
|
344
|
-
region: { enum: ['us', 'eu'] },
|
|
345
|
-
telemetry: { enum: ['on', 'off'] },
|
|
346
|
-
resolve: {
|
|
347
|
-
properties: {
|
|
348
|
-
http: 'ConfigHTTP',
|
|
349
|
-
doNotResolveExamples: { type: 'boolean' },
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
files: {
|
|
353
|
-
type: 'array',
|
|
354
|
-
items: {
|
|
355
|
-
type: 'string',
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
},
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
const ConfigApis: NodeType = {
|
|
362
|
-
properties: {},
|
|
363
|
-
additionalProperties: 'ConfigApisProperties',
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
const createConfigApisProperties = (nodeTypes: Record<string, NodeType>): NodeType => ({
|
|
367
|
-
...nodeTypes['rootRedoclyConfigSchema.apis_additionalProperties'],
|
|
368
|
-
properties: {
|
|
369
|
-
...nodeTypes['rootRedoclyConfigSchema.apis_additionalProperties']?.properties,
|
|
370
|
-
labels: {
|
|
371
|
-
type: 'array',
|
|
372
|
-
items: {
|
|
373
|
-
type: 'string',
|
|
374
|
-
},
|
|
375
|
-
},
|
|
376
|
-
...ConfigStyleguide.properties,
|
|
377
|
-
'features.openapi': 'ConfigReferenceDocs', // deprecated
|
|
378
|
-
'features.mockServer': 'ConfigMockServer', // deprecated
|
|
379
|
-
files: {
|
|
380
|
-
type: 'array',
|
|
381
|
-
items: {
|
|
382
|
-
type: 'string',
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
const ConfigHTTP: NodeType = {
|
|
389
|
-
properties: {
|
|
390
|
-
headers: {
|
|
391
|
-
type: 'array',
|
|
392
|
-
items: {
|
|
393
|
-
type: 'string',
|
|
394
|
-
},
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
const Rules: NodeType = {
|
|
400
|
-
properties: {},
|
|
401
|
-
additionalProperties: (value: unknown, key: string) => {
|
|
402
|
-
if (key.startsWith('rule/')) {
|
|
403
|
-
if (typeof value === 'string') {
|
|
404
|
-
return { enum: ['error', 'warn', 'off'] };
|
|
405
|
-
} else {
|
|
406
|
-
return 'Assert';
|
|
407
|
-
}
|
|
408
|
-
} else if (key.startsWith('assert/')) {
|
|
409
|
-
// keep the old assert/ prefix as an alias
|
|
410
|
-
if (typeof value === 'string') {
|
|
411
|
-
return { enum: ['error', 'warn', 'off'] };
|
|
412
|
-
} else {
|
|
413
|
-
return 'Assert';
|
|
414
|
-
}
|
|
415
|
-
} else if (builtInRules.includes(key as BuiltInRuleId) || isCustomRuleId(key)) {
|
|
416
|
-
if (typeof value === 'string') {
|
|
417
|
-
return { enum: ['error', 'warn', 'off'] };
|
|
418
|
-
} else {
|
|
419
|
-
return 'ObjectRule';
|
|
420
|
-
}
|
|
421
|
-
} else if (key === 'metadata-schema' || key === 'custom-fields-schema') {
|
|
422
|
-
return 'Schema';
|
|
423
|
-
}
|
|
424
|
-
// Otherwise is considered as invalid
|
|
425
|
-
return;
|
|
426
|
-
},
|
|
427
|
-
};
|
|
428
|
-
|
|
429
|
-
const ObjectRule: NodeType = {
|
|
430
|
-
properties: {
|
|
431
|
-
severity: { enum: ['error', 'warn', 'off'] },
|
|
432
|
-
},
|
|
433
|
-
additionalProperties: {},
|
|
434
|
-
required: ['severity'],
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
// TODO: add better type tree for this
|
|
438
|
-
const Schema: NodeType = {
|
|
439
|
-
properties: {},
|
|
440
|
-
additionalProperties: {},
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
function createAssertionDefinitionSubject(nodeNames: string[]): NodeType {
|
|
444
|
-
return {
|
|
445
|
-
properties: {
|
|
446
|
-
type: {
|
|
447
|
-
enum: [...new Set(['any', ...nodeNames, 'SpecExtension'])],
|
|
448
|
-
},
|
|
449
|
-
property: (value: unknown) => {
|
|
450
|
-
if (Array.isArray(value)) {
|
|
451
|
-
return { type: 'array', items: { type: 'string' } };
|
|
452
|
-
} else if (value === null) {
|
|
453
|
-
return null;
|
|
454
|
-
} else {
|
|
455
|
-
return { type: 'string' };
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
filterInParentKeys: { type: 'array', items: { type: 'string' } },
|
|
459
|
-
filterOutParentKeys: { type: 'array', items: { type: 'string' } },
|
|
460
|
-
matchParentKeys: { type: 'string' },
|
|
461
|
-
},
|
|
462
|
-
required: ['type'],
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
const AssertionDefinitionAssertions: NodeType = {
|
|
467
|
-
properties: {
|
|
468
|
-
enum: { type: 'array', items: { type: 'string' } },
|
|
469
|
-
pattern: { type: 'string' },
|
|
470
|
-
notPattern: { type: 'string' },
|
|
471
|
-
casing: {
|
|
472
|
-
enum: [
|
|
473
|
-
'camelCase',
|
|
474
|
-
'kebab-case',
|
|
475
|
-
'snake_case',
|
|
476
|
-
'PascalCase',
|
|
477
|
-
'MACRO_CASE',
|
|
478
|
-
'COBOL-CASE',
|
|
479
|
-
'flatcase',
|
|
480
|
-
],
|
|
481
|
-
},
|
|
482
|
-
mutuallyExclusive: { type: 'array', items: { type: 'string' } },
|
|
483
|
-
mutuallyRequired: { type: 'array', items: { type: 'string' } },
|
|
484
|
-
required: { type: 'array', items: { type: 'string' } },
|
|
485
|
-
requireAny: { type: 'array', items: { type: 'string' } },
|
|
486
|
-
disallowed: { type: 'array', items: { type: 'string' } },
|
|
487
|
-
defined: { type: 'boolean' },
|
|
488
|
-
// undefined: { type: 'boolean' }, // TODO: Remove `undefined` assertion from codebase overall
|
|
489
|
-
nonEmpty: { type: 'boolean' },
|
|
490
|
-
minLength: { type: 'integer' },
|
|
491
|
-
maxLength: { type: 'integer' },
|
|
492
|
-
ref: (value: string | boolean) =>
|
|
493
|
-
typeof value === 'string' ? { type: 'string' } : { type: 'boolean' },
|
|
494
|
-
const: (value: string | boolean | number) => {
|
|
495
|
-
if (typeof value === 'string') {
|
|
496
|
-
return { type: 'string' };
|
|
497
|
-
}
|
|
498
|
-
if (typeof value === 'number') {
|
|
499
|
-
return { type: 'number' };
|
|
500
|
-
}
|
|
501
|
-
if (typeof value === 'boolean') {
|
|
502
|
-
return { type: 'boolean' };
|
|
503
|
-
} else {
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
},
|
|
508
|
-
additionalProperties: (_value: unknown, key: string) => {
|
|
509
|
-
if (/^\w+\/\w+$/.test(key)) return { type: 'object' };
|
|
510
|
-
return;
|
|
511
|
-
},
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
const AssertDefinition: NodeType = {
|
|
515
|
-
properties: {
|
|
516
|
-
subject: 'AssertionDefinitionSubject',
|
|
517
|
-
assertions: 'AssertionDefinitionAssertions',
|
|
518
|
-
},
|
|
519
|
-
required: ['subject', 'assertions'],
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
const Assert: NodeType = {
|
|
523
|
-
properties: {
|
|
524
|
-
subject: 'AssertionDefinitionSubject',
|
|
525
|
-
assertions: 'AssertionDefinitionAssertions',
|
|
526
|
-
where: listOf('AssertDefinition'),
|
|
527
|
-
message: { type: 'string' },
|
|
528
|
-
suggest: { type: 'array', items: { type: 'string' } },
|
|
529
|
-
severity: { enum: ['error', 'warn', 'off'] },
|
|
530
|
-
},
|
|
531
|
-
required: ['subject', 'assertions'],
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
const ConfigLanguage: NodeType = {
|
|
535
|
-
properties: {
|
|
536
|
-
label: { type: 'string' },
|
|
537
|
-
lang: {
|
|
538
|
-
enum: [
|
|
539
|
-
'curl',
|
|
540
|
-
'C#',
|
|
541
|
-
'Go',
|
|
542
|
-
'Java',
|
|
543
|
-
'Java8+Apache',
|
|
544
|
-
'JavaScript',
|
|
545
|
-
'Node.js',
|
|
546
|
-
'PHP',
|
|
547
|
-
'Python',
|
|
548
|
-
'R',
|
|
549
|
-
'Ruby',
|
|
550
|
-
],
|
|
551
|
-
},
|
|
552
|
-
},
|
|
553
|
-
required: ['lang'],
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
const ConfigLabels: NodeType = {
|
|
557
|
-
properties: {
|
|
558
|
-
enum: { type: 'string' },
|
|
559
|
-
enumSingleValue: { type: 'string' },
|
|
560
|
-
enumArray: { type: 'string' },
|
|
561
|
-
default: { type: 'string' },
|
|
562
|
-
deprecated: { type: 'string' },
|
|
563
|
-
example: { type: 'string' },
|
|
564
|
-
examples: { type: 'string' },
|
|
565
|
-
nullable: { type: 'string' },
|
|
566
|
-
recursive: { type: 'string' },
|
|
567
|
-
arrayOf: { type: 'string' },
|
|
568
|
-
webhook: { type: 'string' },
|
|
569
|
-
authorizations: { type: 'string' },
|
|
570
|
-
tryItAuthBasicUsername: { type: 'string' },
|
|
571
|
-
tryItAuthBasicPassword: { type: 'string' },
|
|
572
|
-
},
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
const ConfigSidebarLinks: NodeType = {
|
|
576
|
-
properties: {
|
|
577
|
-
beforeInfo: listOf('CommonConfigSidebarLinks'),
|
|
578
|
-
end: listOf('CommonConfigSidebarLinks'),
|
|
579
|
-
},
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
const CommonConfigSidebarLinks: NodeType = {
|
|
583
|
-
properties: {
|
|
584
|
-
label: { type: 'string' },
|
|
585
|
-
link: { type: 'string' },
|
|
586
|
-
target: { type: 'string' },
|
|
587
|
-
},
|
|
588
|
-
required: ['label', 'link'],
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
const CommonThemeColors: NodeType = {
|
|
592
|
-
properties: {
|
|
593
|
-
main: { type: 'string' },
|
|
594
|
-
light: { type: 'string' },
|
|
595
|
-
dark: { type: 'string' },
|
|
596
|
-
contrastText: { type: 'string' },
|
|
597
|
-
},
|
|
598
|
-
};
|
|
599
|
-
|
|
600
|
-
const CommonColorProps: NodeType = {
|
|
601
|
-
properties: {
|
|
602
|
-
backgroundColor: { type: 'string' },
|
|
603
|
-
borderColor: { type: 'string' },
|
|
604
|
-
color: { type: 'string' },
|
|
605
|
-
tabTextColor: { type: 'string' },
|
|
606
|
-
},
|
|
607
|
-
};
|
|
608
|
-
|
|
609
|
-
const BorderThemeColors: NodeType = {
|
|
610
|
-
properties: pickObjectProps(CommonThemeColors.properties, ['light', 'dark']),
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
const HttpColors: NodeType = {
|
|
614
|
-
properties: {
|
|
615
|
-
basic: { type: 'string' },
|
|
616
|
-
delete: { type: 'string' },
|
|
617
|
-
get: { type: 'string' },
|
|
618
|
-
head: { type: 'string' },
|
|
619
|
-
link: { type: 'string' },
|
|
620
|
-
options: { type: 'string' },
|
|
621
|
-
patch: { type: 'string' },
|
|
622
|
-
post: { type: 'string' },
|
|
623
|
-
put: { type: 'string' },
|
|
624
|
-
},
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
const ResponseColors: NodeType = {
|
|
628
|
-
properties: {
|
|
629
|
-
error: 'CommonColorProps',
|
|
630
|
-
info: 'CommonColorProps',
|
|
631
|
-
redirect: 'CommonColorProps',
|
|
632
|
-
success: 'CommonColorProps',
|
|
633
|
-
},
|
|
634
|
-
};
|
|
635
|
-
|
|
636
|
-
const SecondaryColors: NodeType = {
|
|
637
|
-
properties: omitObjectProps(CommonThemeColors.properties, ['dark']),
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
const TextThemeColors: NodeType = {
|
|
641
|
-
properties: {
|
|
642
|
-
primary: { type: 'string' },
|
|
643
|
-
secondary: { type: 'string' },
|
|
644
|
-
light: { type: 'string' },
|
|
645
|
-
},
|
|
646
|
-
};
|
|
647
|
-
|
|
648
|
-
const ThemeColors: NodeType = {
|
|
649
|
-
properties: {
|
|
650
|
-
accent: 'CommonThemeColors',
|
|
651
|
-
border: 'BorderThemeColors',
|
|
652
|
-
error: 'CommonThemeColors',
|
|
653
|
-
http: 'HttpColors',
|
|
654
|
-
primary: 'CommonThemeColors',
|
|
655
|
-
responses: 'ResponseColors',
|
|
656
|
-
secondary: 'SecondaryColors',
|
|
657
|
-
success: 'CommonThemeColors',
|
|
658
|
-
text: 'TextThemeColors',
|
|
659
|
-
tonalOffset: { type: 'number' },
|
|
660
|
-
warning: 'CommonThemeColors',
|
|
661
|
-
},
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
const SizeProps: NodeType = {
|
|
665
|
-
properties: {
|
|
666
|
-
fontSize: { type: 'string' },
|
|
667
|
-
padding: { type: 'string' },
|
|
668
|
-
minWidth: { type: 'string' },
|
|
669
|
-
},
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
const Sizes: NodeType = {
|
|
673
|
-
properties: {
|
|
674
|
-
small: 'SizeProps',
|
|
675
|
-
medium: 'SizeProps',
|
|
676
|
-
large: 'SizeProps',
|
|
677
|
-
xlarge: 'SizeProps',
|
|
678
|
-
},
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
const FontConfig: NodeType = {
|
|
682
|
-
properties: {
|
|
683
|
-
fontFamily: { type: 'string' },
|
|
684
|
-
fontSize: { type: 'string' },
|
|
685
|
-
fontWeight: { type: 'string' },
|
|
686
|
-
lineHeight: { type: 'string' },
|
|
687
|
-
},
|
|
688
|
-
};
|
|
689
|
-
|
|
690
|
-
const ButtonsConfig: NodeType = {
|
|
691
|
-
properties: {
|
|
692
|
-
...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
693
|
-
borderRadius: { type: 'string' },
|
|
694
|
-
hoverStyle: { type: 'string' },
|
|
695
|
-
boxShadow: { type: 'string' },
|
|
696
|
-
hoverBoxShadow: { type: 'string' },
|
|
697
|
-
sizes: 'Sizes',
|
|
698
|
-
},
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
const BadgeFontConfig: NodeType = {
|
|
702
|
-
properties: pickObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
703
|
-
};
|
|
704
|
-
|
|
705
|
-
const BadgeSizes: NodeType = {
|
|
706
|
-
properties: {
|
|
707
|
-
medium: 'BadgeFontConfig',
|
|
708
|
-
small: 'BadgeFontConfig',
|
|
709
|
-
},
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
const HttpBadgesConfig: NodeType = {
|
|
713
|
-
properties: {
|
|
714
|
-
...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
|
|
715
|
-
borderRadius: { type: 'string' },
|
|
716
|
-
color: { type: 'string' },
|
|
717
|
-
sizes: 'BadgeSizes',
|
|
718
|
-
},
|
|
719
|
-
};
|
|
720
|
-
|
|
721
|
-
const LabelControls: NodeType = {
|
|
722
|
-
properties: {
|
|
723
|
-
top: { type: 'string' },
|
|
724
|
-
width: { type: 'string' },
|
|
725
|
-
height: { type: 'string' },
|
|
726
|
-
},
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
const Panels: NodeType = {
|
|
730
|
-
properties: {
|
|
731
|
-
borderRadius: { type: 'string' },
|
|
732
|
-
backgroundColor: { type: 'string' },
|
|
733
|
-
},
|
|
734
|
-
};
|
|
735
|
-
|
|
736
|
-
const TryItButton: NodeType = {
|
|
737
|
-
properties: {
|
|
738
|
-
fullWidth: { type: 'boolean' },
|
|
739
|
-
},
|
|
740
|
-
};
|
|
741
|
-
|
|
742
|
-
const ConfigThemeComponents: NodeType = {
|
|
743
|
-
properties: {
|
|
744
|
-
buttons: 'ButtonsConfig',
|
|
745
|
-
httpBadges: 'HttpBadgesConfig',
|
|
746
|
-
layoutControls: 'LabelControls',
|
|
747
|
-
panels: 'Panels',
|
|
748
|
-
tryItButton: 'TryItButton',
|
|
749
|
-
tryItSendButton: 'TryItButton',
|
|
750
|
-
},
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
const Breakpoints: NodeType = {
|
|
754
|
-
properties: {
|
|
755
|
-
small: { type: 'string' },
|
|
756
|
-
medium: { type: 'string' },
|
|
757
|
-
large: { type: 'string' },
|
|
758
|
-
},
|
|
759
|
-
};
|
|
760
|
-
|
|
761
|
-
const StackedConfig: NodeType = {
|
|
762
|
-
properties: {
|
|
763
|
-
maxWidth: 'Breakpoints',
|
|
764
|
-
},
|
|
765
|
-
};
|
|
766
|
-
|
|
767
|
-
const ThreePanelConfig: NodeType = {
|
|
768
|
-
properties: {
|
|
769
|
-
maxWidth: 'Breakpoints',
|
|
770
|
-
middlePanelMaxWidth: 'Breakpoints',
|
|
771
|
-
},
|
|
772
|
-
};
|
|
773
|
-
|
|
774
|
-
const Layout: NodeType = {
|
|
775
|
-
properties: {
|
|
776
|
-
showDarkRightPanel: { type: 'boolean' },
|
|
777
|
-
stacked: 'StackedConfig',
|
|
778
|
-
'three-panel': 'ThreePanelConfig',
|
|
779
|
-
},
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
const SchemaColorsConfig: NodeType = {
|
|
783
|
-
properties: {
|
|
784
|
-
backgroundColor: { type: 'string' },
|
|
785
|
-
border: { type: 'string' },
|
|
786
|
-
},
|
|
787
|
-
};
|
|
788
|
-
|
|
789
|
-
const ConfigThemeSchema: NodeType = {
|
|
790
|
-
properties: {
|
|
791
|
-
breakFieldNames: { type: 'boolean' },
|
|
792
|
-
caretColor: { type: 'string' },
|
|
793
|
-
caretSize: { type: 'string' },
|
|
794
|
-
constraints: 'SchemaColorsConfig',
|
|
795
|
-
defaultDetailsWidth: { type: 'string' },
|
|
796
|
-
examples: 'SchemaColorsConfig',
|
|
797
|
-
labelsTextSize: { type: 'string' },
|
|
798
|
-
linesColor: { type: 'string' },
|
|
799
|
-
nestedBackground: { type: 'string' },
|
|
800
|
-
nestingSpacing: { type: 'string' },
|
|
801
|
-
requireLabelColor: { type: 'string' },
|
|
802
|
-
typeNameColor: { type: 'string' },
|
|
803
|
-
typeTitleColor: { type: 'string' },
|
|
804
|
-
},
|
|
805
|
-
};
|
|
806
|
-
|
|
807
|
-
const GroupItemsConfig: NodeType = {
|
|
808
|
-
properties: {
|
|
809
|
-
subItemsColor: { type: 'string' },
|
|
810
|
-
textTransform: { type: 'string' },
|
|
811
|
-
fontWeight: { type: 'string' },
|
|
812
|
-
},
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
const Level1Items: NodeType = {
|
|
816
|
-
properties: pickObjectProps(GroupItemsConfig.properties, ['textTransform']),
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
const SpacingConfig: NodeType = {
|
|
820
|
-
properties: {
|
|
821
|
-
unit: { type: 'number' },
|
|
822
|
-
paddingHorizontal: { type: 'string' },
|
|
823
|
-
paddingVertical: { type: 'string' },
|
|
824
|
-
offsetTop: { type: 'string' },
|
|
825
|
-
offsetLeft: { type: 'string' },
|
|
826
|
-
offsetNesting: { type: 'string' },
|
|
827
|
-
},
|
|
828
|
-
};
|
|
829
|
-
|
|
830
|
-
const Sidebar: NodeType = {
|
|
831
|
-
properties: {
|
|
832
|
-
...omitObjectProps(FontConfig.properties, ['fontWeight', 'lineHeight']),
|
|
833
|
-
activeBgColor: { type: 'string' },
|
|
834
|
-
activeTextColor: { type: 'string' },
|
|
835
|
-
backgroundColor: { type: 'string' },
|
|
836
|
-
borderRadius: { type: 'string' },
|
|
837
|
-
breakPath: { type: 'boolean' },
|
|
838
|
-
caretColor: { type: 'string' },
|
|
839
|
-
caretSize: { type: 'string' },
|
|
840
|
-
groupItems: 'GroupItemsConfig',
|
|
841
|
-
level1items: 'Level1Items',
|
|
842
|
-
rightLineColor: { type: 'string' },
|
|
843
|
-
separatorLabelColor: { type: 'string' },
|
|
844
|
-
showAtBreakpoint: { type: 'string' },
|
|
845
|
-
spacing: 'SpacingConfig',
|
|
846
|
-
textColor: { type: 'string' },
|
|
847
|
-
width: { type: 'string' },
|
|
848
|
-
},
|
|
849
|
-
};
|
|
850
|
-
|
|
851
|
-
const Heading: NodeType = {
|
|
852
|
-
properties: {
|
|
853
|
-
...FontConfig.properties,
|
|
854
|
-
color: { type: 'string' },
|
|
855
|
-
transform: { type: 'string' },
|
|
856
|
-
},
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
const CodeConfig: NodeType = {
|
|
860
|
-
properties: {
|
|
861
|
-
...FontConfig.properties,
|
|
862
|
-
backgroundColor: { type: 'string' },
|
|
863
|
-
color: { type: 'string' },
|
|
864
|
-
wordBreak: {
|
|
865
|
-
enum: [
|
|
866
|
-
'break-all',
|
|
867
|
-
'break-word',
|
|
868
|
-
'keep-all',
|
|
869
|
-
'normal',
|
|
870
|
-
'revert',
|
|
871
|
-
'unset',
|
|
872
|
-
'inherit',
|
|
873
|
-
'initial',
|
|
874
|
-
],
|
|
875
|
-
},
|
|
876
|
-
wrap: { type: 'boolean' },
|
|
877
|
-
},
|
|
878
|
-
};
|
|
879
|
-
|
|
880
|
-
const HeadingsConfig: NodeType = {
|
|
881
|
-
properties: omitObjectProps(FontConfig.properties, ['fontSize']),
|
|
882
|
-
};
|
|
883
|
-
|
|
884
|
-
const LinksConfig: NodeType = {
|
|
885
|
-
properties: {
|
|
886
|
-
color: { type: 'string' },
|
|
887
|
-
hover: { type: 'string' },
|
|
888
|
-
textDecoration: { type: 'string' },
|
|
889
|
-
hoverTextDecoration: { type: 'string' },
|
|
890
|
-
visited: { type: 'string' },
|
|
891
|
-
},
|
|
892
|
-
};
|
|
893
|
-
|
|
894
|
-
const Typography: NodeType = {
|
|
895
|
-
properties: {
|
|
896
|
-
code: 'CodeConfig',
|
|
897
|
-
fieldName: 'FontConfig',
|
|
898
|
-
...pickObjectProps(FontConfig.properties, ['fontSize', 'fontFamily']),
|
|
899
|
-
fontWeightBold: { type: 'string' },
|
|
900
|
-
fontWeightLight: { type: 'string' },
|
|
901
|
-
fontWeightRegular: { type: 'string' },
|
|
902
|
-
heading1: 'Heading',
|
|
903
|
-
heading2: 'Heading',
|
|
904
|
-
heading3: 'Heading',
|
|
905
|
-
headings: 'HeadingsConfig',
|
|
906
|
-
lineHeight: { type: 'string' },
|
|
907
|
-
links: 'LinksConfig',
|
|
908
|
-
optimizeSpeed: { type: 'boolean' },
|
|
909
|
-
rightPanelHeading: 'Heading',
|
|
910
|
-
smoothing: { enum: ['auto', 'none', 'antialiased', 'subpixel-antialiased', 'grayscale'] },
|
|
911
|
-
},
|
|
912
|
-
};
|
|
913
|
-
|
|
914
|
-
const TokenProps: NodeType = {
|
|
915
|
-
properties: {
|
|
916
|
-
color: { type: 'string' },
|
|
917
|
-
...omitObjectProps(FontConfig.properties, ['fontWeight']),
|
|
918
|
-
},
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
const CodeBlock: NodeType = {
|
|
922
|
-
properties: {
|
|
923
|
-
backgroundColor: { type: 'string' },
|
|
924
|
-
borderRadius: { type: 'string' },
|
|
925
|
-
tokens: 'TokenProps',
|
|
926
|
-
},
|
|
927
|
-
};
|
|
928
|
-
|
|
929
|
-
const ConfigThemeLogo: NodeType = {
|
|
930
|
-
properties: {
|
|
931
|
-
gutter: { type: 'string' },
|
|
932
|
-
maxHeight: { type: 'string' },
|
|
933
|
-
maxWidth: { type: 'string' },
|
|
934
|
-
},
|
|
935
|
-
};
|
|
936
|
-
|
|
937
|
-
const Fab: NodeType = {
|
|
938
|
-
properties: {
|
|
939
|
-
backgroundColor: { type: 'string' },
|
|
940
|
-
color: { type: 'string' },
|
|
941
|
-
},
|
|
942
|
-
};
|
|
943
|
-
|
|
944
|
-
const ButtonOverrides: NodeType = {
|
|
945
|
-
properties: {
|
|
946
|
-
custom: { type: 'string' },
|
|
947
|
-
},
|
|
948
|
-
};
|
|
949
|
-
|
|
950
|
-
const Overrides: NodeType = {
|
|
951
|
-
properties: {
|
|
952
|
-
DownloadButton: 'ButtonOverrides',
|
|
953
|
-
NextSectionButton: 'ButtonOverrides',
|
|
954
|
-
},
|
|
955
|
-
};
|
|
956
|
-
|
|
957
|
-
const RightPanel: NodeType = {
|
|
958
|
-
properties: {
|
|
959
|
-
backgroundColor: { type: 'string' },
|
|
960
|
-
panelBackgroundColor: { type: 'string' },
|
|
961
|
-
panelControlsBackgroundColor: { type: 'string' },
|
|
962
|
-
showAtBreakpoint: { type: 'string' },
|
|
963
|
-
textColor: { type: 'string' },
|
|
964
|
-
width: { type: 'string' },
|
|
965
|
-
},
|
|
966
|
-
};
|
|
967
|
-
|
|
968
|
-
const Shape: NodeType = {
|
|
969
|
-
properties: { borderRadius: { type: 'string' } },
|
|
970
|
-
};
|
|
971
|
-
|
|
972
|
-
const ThemeSpacing: NodeType = {
|
|
973
|
-
properties: {
|
|
974
|
-
sectionHorizontal: { type: 'number' },
|
|
975
|
-
sectionVertical: { type: 'number' },
|
|
976
|
-
unit: { type: 'number' },
|
|
977
|
-
},
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
const ConfigTheme: NodeType = {
|
|
981
|
-
properties: {
|
|
982
|
-
breakpoints: 'Breakpoints',
|
|
983
|
-
codeBlock: 'CodeBlock',
|
|
984
|
-
colors: 'ThemeColors',
|
|
985
|
-
components: 'ConfigThemeComponents',
|
|
986
|
-
layout: 'Layout',
|
|
987
|
-
logo: 'ConfigThemeLogo',
|
|
988
|
-
fab: 'Fab',
|
|
989
|
-
overrides: 'Overrides',
|
|
990
|
-
rightPanel: 'RightPanel',
|
|
991
|
-
schema: 'ConfigThemeSchema',
|
|
992
|
-
shape: 'Shape',
|
|
993
|
-
sidebar: 'Sidebar',
|
|
994
|
-
spacing: 'ThemeSpacing',
|
|
995
|
-
typography: 'Typography',
|
|
996
|
-
links: { properties: { color: { type: 'string' } } }, // deprecated
|
|
997
|
-
codeSample: { properties: { backgroundColor: { type: 'string' } } }, // deprecated
|
|
998
|
-
},
|
|
999
|
-
};
|
|
1000
|
-
|
|
1001
|
-
const GenerateCodeSamples: NodeType = {
|
|
1002
|
-
properties: {
|
|
1003
|
-
skipOptionalParameters: { type: 'boolean' },
|
|
1004
|
-
languages: listOf('ConfigLanguage'),
|
|
1005
|
-
},
|
|
1006
|
-
required: ['languages'],
|
|
1007
|
-
};
|
|
1008
|
-
|
|
1009
|
-
// TODO: deprecated
|
|
1010
|
-
const ConfigReferenceDocs: NodeType = {
|
|
1011
|
-
properties: {
|
|
1012
|
-
theme: 'ConfigTheme',
|
|
1013
|
-
corsProxyUrl: { type: 'string' },
|
|
1014
|
-
ctrlFHijack: { type: 'boolean' },
|
|
1015
|
-
defaultSampleLanguage: { type: 'string' },
|
|
1016
|
-
disableDeepLinks: { type: 'boolean' },
|
|
1017
|
-
disableSearch: { type: 'boolean' },
|
|
1018
|
-
disableSidebar: { type: 'boolean' },
|
|
1019
|
-
downloadDefinitionUrl: { type: 'string' },
|
|
1020
|
-
expandDefaultServerVariables: { type: 'boolean' },
|
|
1021
|
-
enumSkipQuotes: { type: 'boolean' },
|
|
1022
|
-
expandDefaultRequest: { type: 'boolean' },
|
|
1023
|
-
expandDefaultResponse: { type: 'boolean' },
|
|
1024
|
-
expandResponses: { type: 'string' },
|
|
1025
|
-
expandSingleSchemaField: { type: 'boolean' },
|
|
1026
|
-
generateCodeSamples: 'GenerateCodeSamples',
|
|
1027
|
-
generatedPayloadSamplesMaxDepth: { type: 'number' },
|
|
1028
|
-
hideDownloadButton: { type: 'boolean' },
|
|
1029
|
-
hideHostname: { type: 'boolean' },
|
|
1030
|
-
hideInfoSection: { type: 'boolean' },
|
|
1031
|
-
hideLoading: { type: 'boolean' },
|
|
1032
|
-
hideLogo: { type: 'boolean' },
|
|
1033
|
-
hideRequestPayloadSample: { type: 'boolean' },
|
|
1034
|
-
hideRightPanel: { type: 'boolean' },
|
|
1035
|
-
hideSchemaPattern: { type: 'boolean' },
|
|
1036
|
-
hideSchemaTitles: { type: 'boolean' },
|
|
1037
|
-
hideSingleRequestSampleTab: { type: 'boolean' },
|
|
1038
|
-
hideSecuritySection: { type: 'boolean' },
|
|
1039
|
-
hideTryItPanel: { type: 'boolean' },
|
|
1040
|
-
hideFab: { type: 'boolean' },
|
|
1041
|
-
hideOneOfDescription: { type: 'boolean' },
|
|
1042
|
-
htmlTemplate: { type: 'string' },
|
|
1043
|
-
jsonSampleExpandLevel: (value: unknown) => {
|
|
1044
|
-
if (typeof value === 'number') {
|
|
1045
|
-
return { type: 'number', minimum: 1 };
|
|
1046
|
-
} else {
|
|
1047
|
-
return { type: 'string' };
|
|
1048
|
-
}
|
|
1049
|
-
},
|
|
1050
|
-
labels: 'ConfigLabels',
|
|
1051
|
-
layout: { enum: ['stacked', 'three-panel'] },
|
|
1052
|
-
maxDisplayedEnumValues: { type: 'number' },
|
|
1053
|
-
menuToggle: { type: 'boolean' },
|
|
1054
|
-
nativeScrollbars: { type: 'boolean' },
|
|
1055
|
-
noAutoAuth: { type: 'boolean' }, // deprecated
|
|
1056
|
-
oAuth2RedirectURI: { type: 'string' },
|
|
1057
|
-
onDeepLinkClick: { type: 'object' },
|
|
1058
|
-
onlyRequiredInSamples: { type: 'boolean' },
|
|
1059
|
-
pagination: { enum: ['none', 'section', 'item'] },
|
|
1060
|
-
pathInMiddlePanel: { type: 'boolean' },
|
|
1061
|
-
payloadSampleIdx: { type: 'number', minimum: 0 },
|
|
1062
|
-
requestInterceptor: { type: 'object' },
|
|
1063
|
-
requiredPropsFirst: { type: 'boolean' },
|
|
1064
|
-
routingBasePath: { type: 'string' },
|
|
1065
|
-
routingStrategy: { type: 'string' }, // deprecated
|
|
1066
|
-
samplesTabsMaxCount: { type: 'number' },
|
|
1067
|
-
schemaExpansionLevel: (value: unknown) => {
|
|
1068
|
-
if (typeof value === 'number') {
|
|
1069
|
-
return { type: 'number', minimum: 0 };
|
|
1070
|
-
} else {
|
|
1071
|
-
return { type: 'string' };
|
|
1072
|
-
}
|
|
1073
|
-
},
|
|
1074
|
-
schemaDefinitionsTagName: { type: 'string' },
|
|
1075
|
-
minCharacterLengthToInitSearch: { type: 'number', minimum: 1 },
|
|
1076
|
-
maxResponseHeadersToShowInTryIt: { type: 'number', minimum: 0 },
|
|
1077
|
-
scrollYOffset: (value: unknown) => {
|
|
1078
|
-
if (typeof value === 'number') {
|
|
1079
|
-
return { type: 'number' };
|
|
1080
|
-
} else {
|
|
1081
|
-
return { type: 'string' };
|
|
1082
|
-
}
|
|
1083
|
-
},
|
|
1084
|
-
searchAutoExpand: { type: 'boolean' },
|
|
1085
|
-
searchFieldLevelBoost: { type: 'number', minimum: 0 },
|
|
1086
|
-
searchMaxDepth: { type: 'number', minimum: 1 },
|
|
1087
|
-
searchMode: { enum: ['default', 'path-only'] },
|
|
1088
|
-
searchOperationTitleBoost: { type: 'number' },
|
|
1089
|
-
searchTagTitleBoost: { type: 'number' },
|
|
1090
|
-
sendXUserAgentInTryIt: { type: 'boolean' },
|
|
1091
|
-
showChangeLayoutButton: { type: 'boolean' },
|
|
1092
|
-
showConsole: { type: 'boolean' }, // deprecated
|
|
1093
|
-
showExtensions: (value: unknown) => {
|
|
1094
|
-
if (typeof value === 'boolean') {
|
|
1095
|
-
return { type: 'boolean' };
|
|
1096
|
-
} else {
|
|
1097
|
-
return {
|
|
1098
|
-
type: 'array',
|
|
1099
|
-
items: {
|
|
1100
|
-
type: 'string',
|
|
1101
|
-
},
|
|
1102
|
-
};
|
|
1103
|
-
}
|
|
1104
|
-
},
|
|
1105
|
-
showNextButton: { type: 'boolean' },
|
|
1106
|
-
showRightPanelToggle: { type: 'boolean' },
|
|
1107
|
-
showSecuritySchemeType: { type: 'boolean' },
|
|
1108
|
-
showWebhookVerb: { type: 'boolean' },
|
|
1109
|
-
showObjectSchemaExamples: { type: 'boolean' },
|
|
1110
|
-
disableTryItRequestUrlEncoding: { type: 'boolean' },
|
|
1111
|
-
sidebarLinks: 'ConfigSidebarLinks',
|
|
1112
|
-
sideNavStyle: { enum: ['summary-only', 'path-first', 'id-only', 'path-only'] },
|
|
1113
|
-
simpleOneOfTypeLabel: { type: 'boolean' },
|
|
1114
|
-
sortEnumValuesAlphabetically: { type: 'boolean' },
|
|
1115
|
-
sortOperationsAlphabetically: { type: 'boolean' },
|
|
1116
|
-
sortPropsAlphabetically: { type: 'boolean' },
|
|
1117
|
-
sortTagsAlphabetically: { type: 'boolean' },
|
|
1118
|
-
suppressWarnings: { type: 'boolean' }, // deprecated
|
|
1119
|
-
unstable_externalDescription: { type: 'boolean' }, // deprecated
|
|
1120
|
-
unstable_ignoreMimeParameters: { type: 'boolean' },
|
|
1121
|
-
untrustedDefinition: { type: 'boolean' },
|
|
1122
|
-
mockServer: {
|
|
1123
|
-
properties: {
|
|
1124
|
-
url: { type: 'string' },
|
|
1125
|
-
position: { enum: ['first', 'last', 'replace', 'off'] },
|
|
1126
|
-
description: { type: 'string' },
|
|
1127
|
-
},
|
|
1128
|
-
},
|
|
1129
|
-
showAccessMode: { type: 'boolean' },
|
|
1130
|
-
preserveOriginalExtensionsName: { type: 'boolean' },
|
|
1131
|
-
markdownHeadingsAnchorLevel: { type: 'number' },
|
|
1132
|
-
},
|
|
1133
|
-
additionalProperties: {},
|
|
1134
|
-
};
|
|
1135
|
-
|
|
1136
|
-
const ConfigMockServer: NodeType = {
|
|
1137
|
-
properties: {
|
|
1138
|
-
strictExamples: { type: 'boolean' },
|
|
1139
|
-
errorIfForcedExampleNotFound: { type: 'boolean' },
|
|
1140
|
-
},
|
|
1141
|
-
};
|
|
1142
|
-
|
|
1143
|
-
export function createConfigTypes(extraSchemas: JSONSchema, config?: Config) {
|
|
1144
|
-
const nodeNames = Object.values(SpecVersion).flatMap((version) => {
|
|
1145
|
-
const types = config?.styleguide
|
|
1146
|
-
? config.styleguide.extendTypes(getTypes(version), version)
|
|
1147
|
-
: getTypes(version);
|
|
1148
|
-
return Object.keys(types);
|
|
1149
|
-
});
|
|
1150
|
-
// Create types based on external schemas
|
|
1151
|
-
const nodeTypes = getNodeTypesFromJSONSchema('rootRedoclyConfigSchema', extraSchemas);
|
|
1152
|
-
|
|
1153
|
-
return {
|
|
1154
|
-
...CoreConfigTypes,
|
|
1155
|
-
ConfigRoot: createConfigRoot(nodeTypes), // This is the REAL config root type
|
|
1156
|
-
ConfigApisProperties: createConfigApisProperties(nodeTypes),
|
|
1157
|
-
AssertionDefinitionSubject: createAssertionDefinitionSubject(nodeNames),
|
|
1158
|
-
...nodeTypes,
|
|
1159
|
-
};
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
const CoreConfigTypes: Record<string, NodeType> = {
|
|
1163
|
-
Assert,
|
|
1164
|
-
ConfigApis,
|
|
1165
|
-
ConfigStyleguide,
|
|
1166
|
-
ConfigReferenceDocs,
|
|
1167
|
-
ConfigMockServer,
|
|
1168
|
-
ConfigHTTP,
|
|
1169
|
-
ConfigLanguage,
|
|
1170
|
-
ConfigLabels,
|
|
1171
|
-
ConfigSidebarLinks,
|
|
1172
|
-
CommonConfigSidebarLinks,
|
|
1173
|
-
ConfigTheme,
|
|
1174
|
-
AssertDefinition,
|
|
1175
|
-
ThemeColors,
|
|
1176
|
-
CommonThemeColors,
|
|
1177
|
-
BorderThemeColors,
|
|
1178
|
-
HttpColors,
|
|
1179
|
-
ResponseColors,
|
|
1180
|
-
SecondaryColors,
|
|
1181
|
-
TextThemeColors,
|
|
1182
|
-
Sizes,
|
|
1183
|
-
ButtonsConfig,
|
|
1184
|
-
CommonColorProps,
|
|
1185
|
-
BadgeFontConfig,
|
|
1186
|
-
BadgeSizes,
|
|
1187
|
-
HttpBadgesConfig,
|
|
1188
|
-
LabelControls,
|
|
1189
|
-
Panels,
|
|
1190
|
-
TryItButton,
|
|
1191
|
-
Breakpoints,
|
|
1192
|
-
StackedConfig,
|
|
1193
|
-
ThreePanelConfig,
|
|
1194
|
-
SchemaColorsConfig,
|
|
1195
|
-
SizeProps,
|
|
1196
|
-
Level1Items,
|
|
1197
|
-
SpacingConfig,
|
|
1198
|
-
FontConfig,
|
|
1199
|
-
CodeConfig,
|
|
1200
|
-
HeadingsConfig,
|
|
1201
|
-
LinksConfig,
|
|
1202
|
-
TokenProps,
|
|
1203
|
-
CodeBlock,
|
|
1204
|
-
ConfigThemeLogo,
|
|
1205
|
-
Fab,
|
|
1206
|
-
ButtonOverrides,
|
|
1207
|
-
Overrides,
|
|
1208
|
-
ObjectRule,
|
|
1209
|
-
Schema,
|
|
1210
|
-
RightPanel,
|
|
1211
|
-
Rules,
|
|
1212
|
-
Shape,
|
|
1213
|
-
ThemeSpacing,
|
|
1214
|
-
GenerateCodeSamples,
|
|
1215
|
-
GroupItemsConfig,
|
|
1216
|
-
ConfigThemeComponents,
|
|
1217
|
-
Layout,
|
|
1218
|
-
ConfigThemeSchema,
|
|
1219
|
-
Sidebar,
|
|
1220
|
-
Heading,
|
|
1221
|
-
Typography,
|
|
1222
|
-
AssertionDefinitionAssertions,
|
|
1223
|
-
};
|
|
1224
|
-
|
|
1225
|
-
export const ConfigTypes: Record<string, NodeType> = createConfigTypes(rootRedoclyConfigSchema);
|
|
1226
|
-
export const NormalizedConfigTypes = normalizeTypes(ConfigTypes);
|