@kubb/agent 4.33.1 → 4.33.2
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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +18 -87
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/index.js +17 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/constants.js +180 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/parse.js +1085 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/picomatch.js +341 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/scan.js +391 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/lib/utils.js +72 -0
- package/.output/server/node_modules/.nitro/picomatch@4.0.3/package.json +83 -0
- package/.output/server/node_modules/@redocly/ajv/dist/2020.js +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/ajv.js +50 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/code.js +156 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/index.js +697 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/scope.js +143 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/errors.js +123 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/index.js +249 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/names.js +29 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/ref_error.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/resolve.js +155 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/rules.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/util.js +178 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/applicability.js +19 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/boolSchema.js +50 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/dataType.js +203 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/defaults.js +35 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/index.js +534 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/keyword.js +124 -0
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/subschema.js +81 -0
- package/.output/server/node_modules/@redocly/ajv/dist/core.js +632 -0
- package/.output/server/node_modules/@redocly/ajv/dist/draft4.js +56 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/data.json +13 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/index.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/content.json +17 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/core.json +51 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/schema.json +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-04.json +138 -0
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/equal.js +7 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/ucs2length.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/uri.js +6 -0
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/validation_error.js +11 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalItems.js +49 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalProperties.js +107 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/allOf.js +23 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/anyOf.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/contains.js +95 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependencies.js +85 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependentSchemas.js +11 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/if.js +66 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/index.js +44 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items.js +52 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items2020.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/not.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/oneOf.js +60 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/patternProperties.js +75 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/prefixItems.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/properties.js +55 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/propertyNames.js +38 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/thenElse.js +13 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/code.js +138 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/id.js +10 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/index.js +16 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/ref.js +132 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/index.js +139 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/types.js +9 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft2020.js +23 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft4.js +29 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft7.js +17 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +30 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicRef.js +51 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/index.js +9 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +16 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveRef.js +10 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/format.js +92 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/index.js +6 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/metadata.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/next.js +8 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/oasContext.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/index.js +7 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +40 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +84 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/const.js +25 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/dependentRequired.js +12 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumber.js +43 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +19 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/enum.js +48 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/index.js +37 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitContains.js +15 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitItems.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitLength.js +27 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitNumber.js +27 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitProperties.js +24 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/multipleOf.js +26 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/pattern.js +33 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/readOnly.js +20 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/required.js +86 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/uniqueItems.js +64 -0
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/writeOnly.js +20 -0
- package/.output/server/node_modules/@redocly/ajv/package.json +130 -0
- package/.output/server/node_modules/@redocly/config/lib/common.js +103 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/config.js +17 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/entities.js +58 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/enum.js +6 -0
- package/.output/server/node_modules/@redocly/config/lib/constants/shared.js +22 -0
- package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +54 -0
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-config-schema.js +186 -0
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-entity-file-schema.js +283 -0
- package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +682 -0
- package/.output/server/node_modules/@redocly/config/lib/feedback-config-schema.js +88 -0
- package/.output/server/node_modules/@redocly/config/lib/graphql-config-schema.js +157 -0
- package/.output/server/node_modules/@redocly/config/lib/index.js +41 -0
- package/.output/server/node_modules/@redocly/config/lib/product-override-schema.js +43 -0
- package/.output/server/node_modules/@redocly/config/lib/redoc-config-schema.js +120 -0
- package/.output/server/node_modules/@redocly/config/lib/reference-docs-config-schema.js +518 -0
- package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +25 -0
- package/.output/server/node_modules/@redocly/config/lib/reunite-config-schema.js +103 -0
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +558 -0
- package/.output/server/node_modules/@redocly/config/lib/scorecards-config-schema.js +242 -0
- package/.output/server/node_modules/@redocly/config/lib/types/api-functions-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/catalog-entity-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/code-walkthrough-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/config-types.js +3 -0
- package/.output/server/node_modules/@redocly/config/lib/types/index.js +21 -0
- package/.output/server/node_modules/@redocly/config/lib/types/portal-shared-types.js +18 -0
- package/.output/server/node_modules/@redocly/config/package.json +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +85 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +257 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle.js +74 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/all.js +310 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/builtIn.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/bundle-extends.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config-resolvers.js +335 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +338 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/constants.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/get-resolve-config.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/group-assertion-rules.js +51 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/index.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/load.js +98 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/minimal.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended-strict.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/rules.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/spec.js +289 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/types.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/utils.js +129 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/visitors.js +99 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/arazzo/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async2/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async3/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-helper.js +65 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-description-override.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-override.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/media-type-examples-override.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/operation-description-override.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/remove-x-internal.js +68 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/tag-description-override.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +88 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +116 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/openrpc/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/overlay1/index.js +2 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/detect-spec.js +79 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/env.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/errors/yaml-parse-error.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/codeframes.js +177 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/format.js +365 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/index.js +49 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/js-yaml/index.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint-entity.js +171 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint.js +123 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/logger.js +56 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/oas-types.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/ref-utils.js +109 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/resolve.js +326 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/ajv.js +106 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/criteria-unique.js +68 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/index.js +52 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/outputs-defined.js +139 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/parameters-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/requestBody-replacements-unique.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescription-type.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-name-unique.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-not-empty.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onFailure-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onSuccess-unique.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/stepId-unique.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflow-dependsOn.js +53 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflowId-unique.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/channels-kebab-case.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/index.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/no-channel-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/channels-kebab-case.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/index.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/no-channel-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/catalog-entity/entity-key-valid.js +39 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/asserts.js +269 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/index.js +22 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/utils.js +215 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-contact.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license-strict.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-ambiguous-paths.js +42 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-duplicated-tag-names.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-enum-type-mismatch.js +38 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-identical-paths.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-parameter-examples.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-schema-examples.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-path-trailing-slash.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +78 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-schema-type-mismatch.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-unresolved-refs.js +42 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-2xx-response.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-4xx-response.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-description.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-unique.js +17 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-url-safe.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-parameters-unique.js +37 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-singular-tag.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-summary.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-tag-defined.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/parameter-description.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-declaration-must-exist.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-http-verbs-order.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-not-include-query.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-params-defined.js +145 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-segment-plural.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/paths-kebab-case.js +17 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/required-string-property-missing-min-length.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/response-contains-header.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/scalar-property-missing-example.js +39 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/security-defined.js +62 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/spec-strict-refs.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/struct.js +150 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tag-description.js +9 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tags-alphabetical.js +18 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/boolean-parameter-prefixes.js +19 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/index.js +93 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/request-mime-type.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-contains-property.js +34 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-mime-type.js +14 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/array-parameter-serialization.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/boolean-parameter-prefixes.js +21 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/component-name-unique.js +130 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/index.js +129 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-empty-servers.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-example-value-and-externalValue.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-invalid-media-type-examples.js +59 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-example.com.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-trailing-slash.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-variables-empty-enum.js +58 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-undefined-server-variable.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-unused-components.js +83 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/nullable-type-sibling.js +15 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +33 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/request-mime-type.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-contains-property.js +36 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-mime-type.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-components-invalid-map-name.js +59 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-discriminator-defaultMapping.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-example-values.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +16 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-tag-parents.js +38 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-querystring-parameters.js +65 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/index.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/no-unused-components.js +82 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-duplicated-method-params.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-required-params-after-optional.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/other/stats.js +190 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/overlay1/index.js +12 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-criteria-xpath.js +20 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +30 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +25 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/respect-supported-versions.js +18 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-name-reference.js +35 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-required-values.js +60 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/utils.js +172 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/arazzo.js +482 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi2.js +1157 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi3.js +511 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/entity.js +32 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/index.js +90 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-adapter.js +181 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-draft7.shared.js +101 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas2.js +454 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3.js +828 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_1.js +292 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_2.js +306 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/openrpc.js +360 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/overlay.js +61 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/redocly-yaml.js +573 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/typings/arazzo.js +3 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/assign-config.js +28 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/dequal.js +36 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/does-yaml-file-exist.js +7 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/error.js +3 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-intersection-length.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-matching-status-code-range.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-own.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/identity.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-custom-rule-id.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-defined.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-array.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-object.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-array.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-object.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-string.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-ordered.js +27 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-path-parameter.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-plain-object.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-string.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-truthy.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/keys-of.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/make-ref-id.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/next-tick.js +6 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/oas-has-component.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/omit.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pause.js +4 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pluralize.js +8 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/read-file-from-url.js +26 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/regex-from-string.js +5 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/scorecards.js +99 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/slash.js +11 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/split-camel-case-into-words.js +13 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/stack.js +7 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/validate-mime-type.js +31 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/yaml-fs-helper.js +23 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/visitors.js +177 -0
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +303 -0
- package/.output/server/node_modules/@redocly/openapi-core/package.json +74 -0
- package/.output/server/node_modules/ajv-formats/dist/formats.js +208 -0
- package/.output/server/node_modules/ajv-formats/dist/index.js +37 -0
- package/.output/server/node_modules/ajv-formats/dist/limit.js +69 -0
- package/.output/server/node_modules/ajv-formats/package.json +74 -0
- package/.output/server/node_modules/colorette/index.js +82 -0
- package/.output/server/node_modules/colorette/package.json +39 -0
- package/.output/server/node_modules/js-levenshtein/index.js +105 -0
- package/.output/server/node_modules/js-levenshtein/package.json +49 -0
- package/.output/server/node_modules/pluralize/package.json +40 -0
- package/.output/server/node_modules/pluralize/pluralize.js +503 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/common.js +45 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/dumper.js +644 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/exception.js +40 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/index.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/loader.js +1416 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/mark.js +62 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/scalarInference.js +82 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/core.js +8 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_full.js +14 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_safe.js +19 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/failsafe.js +10 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/json.js +14 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema.js +78 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/binary.js +92 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/bool.js +32 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/float.js +95 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/int.js +155 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/regexp.js +64 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/undefined.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/map.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/merge.js +10 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/null.js +30 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/omap.js +46 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/pairs.js +55 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/seq.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/set.js +22 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/str.js +7 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/timestamp.js +70 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type.js +54 -0
- package/.output/server/node_modules/yaml-ast-parser/dist/src/yamlAST.js +82 -0
- package/.output/server/node_modules/yaml-ast-parser/package.json +39 -0
- package/.output/server/package.json +9 -1
- package/package.json +16 -16
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/index.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/constants.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/parse.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/picomatch.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/scan.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/lib/utils.js +0 -0
- /package/.output/server/node_modules/{picomatch → .nitro/picomatch@2.3.1}/package.json +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const NoUndefinedServerVariable = () => {
|
|
2
|
+
return {
|
|
3
|
+
Server(server, { report, location }) {
|
|
4
|
+
if (!server?.url)
|
|
5
|
+
return;
|
|
6
|
+
const urlVariables = server.url.match(/{[^}]+}/g)?.map((e) => e.slice(1, e.length - 1)) || [];
|
|
7
|
+
const definedVariables = (server?.variables && Object.keys(server.variables)) || [];
|
|
8
|
+
for (const serverVar of urlVariables) {
|
|
9
|
+
if (!definedVariables.includes(serverVar)) {
|
|
10
|
+
report({
|
|
11
|
+
message: `The \`${serverVar}\` variable is not defined in the \`variables\` objects.`,
|
|
12
|
+
location: location.child(['url']),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
for (const definedServerVar of definedVariables) {
|
|
17
|
+
if (!urlVariables.includes(definedServerVar)) {
|
|
18
|
+
report({
|
|
19
|
+
message: `The \`${definedServerVar}\` variable is not used in the server's \`url\` field.`,
|
|
20
|
+
location: location.child(['variables', definedServerVar]).key(),
|
|
21
|
+
from: location.child('url'),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=no-undefined-server-variable.js.map
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-unused-components.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export const NoUnusedComponents = () => {
|
|
2
|
+
const components = new Map();
|
|
3
|
+
function registerComponent(location, name) {
|
|
4
|
+
components.set(location.absolutePointer, {
|
|
5
|
+
used: components.get(location.absolutePointer)?.used || false,
|
|
6
|
+
location,
|
|
7
|
+
name,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
ref(ref, { type, resolve, key, location }) {
|
|
12
|
+
if ([
|
|
13
|
+
'Schema',
|
|
14
|
+
'Header',
|
|
15
|
+
'Parameter',
|
|
16
|
+
'Response',
|
|
17
|
+
'Example',
|
|
18
|
+
'RequestBody',
|
|
19
|
+
'MediaTypesMap',
|
|
20
|
+
].includes(type.name)) {
|
|
21
|
+
const resolvedRef = resolve(ref);
|
|
22
|
+
if (!resolvedRef.location)
|
|
23
|
+
return;
|
|
24
|
+
components.set(resolvedRef.location.absolutePointer, {
|
|
25
|
+
used: true,
|
|
26
|
+
name: key.toString(),
|
|
27
|
+
location,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
Root: {
|
|
32
|
+
leave(_, { report }) {
|
|
33
|
+
components.forEach((usageInfo) => {
|
|
34
|
+
if (!usageInfo.used) {
|
|
35
|
+
report({
|
|
36
|
+
message: `Component: "${usageInfo.name}" is never used.`,
|
|
37
|
+
location: usageInfo.location.key(),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
NamedSchemas: {
|
|
44
|
+
Schema(schema, { location, key }) {
|
|
45
|
+
if (!schema.allOf) {
|
|
46
|
+
// FIXME: find a better way to detect possible discriminator
|
|
47
|
+
registerComponent(location, key.toString());
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
NamedParameters: {
|
|
52
|
+
Parameter(_parameter, { location, key }) {
|
|
53
|
+
registerComponent(location, key.toString());
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
NamedResponses: {
|
|
57
|
+
Response(_response, { location, key }) {
|
|
58
|
+
registerComponent(location, key.toString());
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
NamedExamples: {
|
|
62
|
+
Example(_example, { location, key }) {
|
|
63
|
+
registerComponent(location, key.toString());
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
NamedRequestBodies: {
|
|
67
|
+
RequestBody(_requestBody, { location, key }) {
|
|
68
|
+
registerComponent(location, key.toString());
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
NamedHeaders: {
|
|
72
|
+
Header(_header, { location, key }) {
|
|
73
|
+
registerComponent(location, key.toString());
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
NamedMediaTypes: {
|
|
77
|
+
MediaTypesMap(_mediaTypesMap, { location, key }) {
|
|
78
|
+
registerComponent(location, key.toString());
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=no-unused-components.js.map
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/nullable-type-sibling.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const NullableTypeSibling = () => {
|
|
2
|
+
return {
|
|
3
|
+
Schema: {
|
|
4
|
+
leave(schema, ctx) {
|
|
5
|
+
if ('nullable' in schema && !('type' in schema)) {
|
|
6
|
+
ctx.report({
|
|
7
|
+
message: `The \`type\` field must be defined when the \`nullable\` field is used.`,
|
|
8
|
+
location: ctx.location.child(['nullable']),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=nullable-type-sibling.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { validateDefinedAndNonEmpty } from '../utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validation according to rfc7807 - https://datatracker.ietf.org/doc/html/rfc7807
|
|
4
|
+
*/
|
|
5
|
+
export const Operation4xxProblemDetailsRfc7807 = () => {
|
|
6
|
+
return {
|
|
7
|
+
Response: {
|
|
8
|
+
skip(_, key) {
|
|
9
|
+
return !/4[Xx0-9]{2}/.test(`${key}`);
|
|
10
|
+
},
|
|
11
|
+
enter(response, { report, location }) {
|
|
12
|
+
if (!response.content || !response.content['application/problem+json'])
|
|
13
|
+
report({
|
|
14
|
+
message: 'Response `4xx` must have content-type `application/problem+json`.',
|
|
15
|
+
location: location.key(),
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
MediaType: {
|
|
19
|
+
skip(_, key) {
|
|
20
|
+
return key !== 'application/problem+json';
|
|
21
|
+
},
|
|
22
|
+
enter(media, ctx) {
|
|
23
|
+
validateDefinedAndNonEmpty('schema', media, ctx);
|
|
24
|
+
},
|
|
25
|
+
SchemaProperties(schema, ctx) {
|
|
26
|
+
validateDefinedAndNonEmpty('type', schema, ctx);
|
|
27
|
+
validateDefinedAndNonEmpty('title', schema, ctx);
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=operation-4xx-problem-details-rfc7807.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { validateMimeTypeOAS3 } from '../../utils/validate-mime-type.js';
|
|
2
|
+
export const RequestMimeType = ({ allowedValues }) => {
|
|
3
|
+
return {
|
|
4
|
+
Paths: {
|
|
5
|
+
RequestBody: {
|
|
6
|
+
leave(requestBody, ctx) {
|
|
7
|
+
validateMimeTypeOAS3({ type: 'consumes', value: requestBody }, ctx, allowedValues);
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
Callback: {
|
|
11
|
+
RequestBody() { },
|
|
12
|
+
Response: {
|
|
13
|
+
leave(response, ctx) {
|
|
14
|
+
validateMimeTypeOAS3({ type: 'consumes', value: response }, ctx, allowedValues);
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
WebhooksMap: {
|
|
20
|
+
Response: {
|
|
21
|
+
leave(response, ctx) {
|
|
22
|
+
validateMimeTypeOAS3({ type: 'consumes', value: response }, ctx, allowedValues);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=request-mime-type.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getMatchingStatusCodeRange } from '../../utils/get-matching-status-code-range.js';
|
|
2
|
+
export const ResponseContainsProperty = (options) => {
|
|
3
|
+
const names = options.names || {};
|
|
4
|
+
let key;
|
|
5
|
+
return {
|
|
6
|
+
Operation: {
|
|
7
|
+
Response: {
|
|
8
|
+
skip: (_response, key) => {
|
|
9
|
+
return `${key}` === '204';
|
|
10
|
+
},
|
|
11
|
+
enter: (_response, ctx) => {
|
|
12
|
+
key = ctx.key;
|
|
13
|
+
},
|
|
14
|
+
MediaType: {
|
|
15
|
+
Schema(schema, { report, location }) {
|
|
16
|
+
if (schema.type !== 'object')
|
|
17
|
+
return;
|
|
18
|
+
const expectedProperties = names[key] ||
|
|
19
|
+
names[getMatchingStatusCodeRange(key)] ||
|
|
20
|
+
names[getMatchingStatusCodeRange(key).toLowerCase()] ||
|
|
21
|
+
[];
|
|
22
|
+
for (const expectedProperty of expectedProperties) {
|
|
23
|
+
if (!schema.properties?.[expectedProperty]) {
|
|
24
|
+
report({
|
|
25
|
+
message: `Response object must contain a top-level "${expectedProperty}" property.`,
|
|
26
|
+
location: location.child('properties').key(),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=response-contains-property.js.map
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-mime-type.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { validateMimeTypeOAS3 } from '../../utils/validate-mime-type.js';
|
|
2
|
+
export const ResponseMimeType = ({ allowedValues }) => {
|
|
3
|
+
return {
|
|
4
|
+
Paths: {
|
|
5
|
+
Response: {
|
|
6
|
+
leave(response, ctx) {
|
|
7
|
+
validateMimeTypeOAS3({ type: 'produces', value: response }, ctx, allowedValues);
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
Callback: {
|
|
11
|
+
Response() { },
|
|
12
|
+
RequestBody: {
|
|
13
|
+
leave(requestBody, ctx) {
|
|
14
|
+
validateMimeTypeOAS3({ type: 'produces', value: requestBody }, ctx, allowedValues);
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
WebhooksMap: {
|
|
20
|
+
RequestBody: {
|
|
21
|
+
leave(requestBody, ctx) {
|
|
22
|
+
validateMimeTypeOAS3({ type: 'produces', value: requestBody }, ctx, allowedValues);
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=response-mime-type.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export const SpecComponentsInvalidMapName = () => {
|
|
2
|
+
const KEYS_REGEX = '^[a-zA-Z0-9\\.\\-_]+$';
|
|
3
|
+
function validateKey(key, report, location, component) {
|
|
4
|
+
if (!new RegExp(KEYS_REGEX).test(key)) {
|
|
5
|
+
report({
|
|
6
|
+
message: `The map key in ${component} "${key}" does not match the regular expression "${KEYS_REGEX}"`,
|
|
7
|
+
location: location.key(),
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
NamedSchemas: {
|
|
13
|
+
Schema(_node, { key, report, location }) {
|
|
14
|
+
validateKey(key, report, location, 'schemas');
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
NamedParameters: {
|
|
18
|
+
Parameter(_node, { key, report, location }) {
|
|
19
|
+
validateKey(key, report, location, 'parameters');
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
NamedResponses: {
|
|
23
|
+
Response(_node, { key, report, location }) {
|
|
24
|
+
validateKey(key, report, location, 'responses');
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
NamedExamples: {
|
|
28
|
+
Example(_node, { key, report, location }) {
|
|
29
|
+
validateKey(key, report, location, 'examples');
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
NamedRequestBodies: {
|
|
33
|
+
RequestBody(_node, { key, report, location }) {
|
|
34
|
+
validateKey(key, report, location, 'requestBodies');
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
NamedHeaders: {
|
|
38
|
+
Header(_node, { key, report, location }) {
|
|
39
|
+
validateKey(key, report, location, 'headers');
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
NamedSecuritySchemes: {
|
|
43
|
+
SecurityScheme(_node, { key, report, location }) {
|
|
44
|
+
validateKey(key, report, location, 'securitySchemes');
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
NamedLinks: {
|
|
48
|
+
Link(_node, { key, report, location }) {
|
|
49
|
+
validateKey(key, report, location, 'links');
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
NamedCallbacks: {
|
|
53
|
+
Callback(_node, { key, report, location }) {
|
|
54
|
+
validateKey(key, report, location, 'callbacks');
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=spec-components-invalid-map-name.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const SpecDiscriminatorDefaultMapping = () => {
|
|
2
|
+
let componentsSchemaNames;
|
|
3
|
+
return {
|
|
4
|
+
NamedSchemas: {
|
|
5
|
+
enter(schemas) {
|
|
6
|
+
componentsSchemaNames = Object.keys(schemas);
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
Schema: {
|
|
10
|
+
leave(schema, ctx) {
|
|
11
|
+
if (!schema.discriminator?.propertyName)
|
|
12
|
+
return;
|
|
13
|
+
const defaultMapping = schema.discriminator.defaultMapping;
|
|
14
|
+
const isPropertyOptional = !schema.required?.includes(schema.discriminator.propertyName);
|
|
15
|
+
if (isPropertyOptional && defaultMapping === undefined) {
|
|
16
|
+
ctx.report({
|
|
17
|
+
message: `Discriminator with optional property '${schema.discriminator.propertyName}' must include a defaultMapping field.`,
|
|
18
|
+
location: ctx.location.child('discriminator'),
|
|
19
|
+
});
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (defaultMapping !== undefined && !componentsSchemaNames.includes(defaultMapping)) {
|
|
23
|
+
ctx.report({
|
|
24
|
+
message: `defaultMapping value '${defaultMapping}' does not point to an existing schema component.`,
|
|
25
|
+
location: ctx.location.child(['discriminator', 'defaultMapping']),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=spec-discriminator-defaultMapping.js.map
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-example-values.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const SpecExampleValues = () => {
|
|
2
|
+
return {
|
|
3
|
+
Example({ value, externalValue, dataValue, serializedValue }, { report, location }) {
|
|
4
|
+
if (value !== undefined && externalValue !== undefined) {
|
|
5
|
+
report({
|
|
6
|
+
message: "The 'value' and 'externalValue' fields of an example object are mutually exclusive.",
|
|
7
|
+
location: location,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
if (serializedValue !== undefined && externalValue !== undefined) {
|
|
11
|
+
report({
|
|
12
|
+
message: "The 'serializedValue' and 'externalValue' fields of an example object are mutually exclusive.",
|
|
13
|
+
location: location,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (value !== undefined && dataValue !== undefined) {
|
|
17
|
+
report({
|
|
18
|
+
message: "The 'value' filed must be absent if 'dataValue' is present in an example object.",
|
|
19
|
+
location: location.child('value').key(),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (value !== undefined && serializedValue !== undefined) {
|
|
23
|
+
report({
|
|
24
|
+
message: "The 'value' filed must be absent if 'serializedValue' is present in an example object.",
|
|
25
|
+
location: location.child('value').key(),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=spec-example-values.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const SpecNoInvalidEncodingCombinations = () => {
|
|
2
|
+
return {
|
|
3
|
+
MediaType: {
|
|
4
|
+
leave(mediaType, ctx) {
|
|
5
|
+
if (('prefixEncoding' in mediaType && 'encoding' in mediaType) ||
|
|
6
|
+
('itemEncoding' in mediaType && 'encoding' in mediaType)) {
|
|
7
|
+
ctx.report({
|
|
8
|
+
message: "The 'encoding' field cannot be used together with 'prefixEncoding' or 'itemEncoding'.",
|
|
9
|
+
location: ctx.location.child('encoding').key(),
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=spec-no-invalid-encoding-combinations.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const SpecNoInvalidTagParents = () => {
|
|
2
|
+
let tags;
|
|
3
|
+
return {
|
|
4
|
+
Root: {
|
|
5
|
+
enter(root) {
|
|
6
|
+
tags = root.tags ?? [];
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
Tag: {
|
|
10
|
+
leave(tag, { report, location }) {
|
|
11
|
+
if (tag?.parent === undefined) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!tags.find((t) => t.name === tag.parent)) {
|
|
15
|
+
report({
|
|
16
|
+
message: `Tag parent '${tag.parent}' is not defined in the API description.`,
|
|
17
|
+
location: location.child('parent'),
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const visited = new Set(tag.name);
|
|
22
|
+
let currentParent = tag.parent;
|
|
23
|
+
while (currentParent !== undefined) {
|
|
24
|
+
if (visited.has(currentParent)) {
|
|
25
|
+
report({
|
|
26
|
+
message: `Circular reference detected in tag parent hierarchy for tag '${tag.name}'.`,
|
|
27
|
+
location: location.child('parent'),
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
visited.add(currentParent);
|
|
32
|
+
currentParent = tags.find((t) => t.name === currentParent)?.parent;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=spec-no-invalid-tag-parents.js.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function countQuerystring(parameters) {
|
|
2
|
+
return parameters.filter((p) => !('$ref' in p) && p.in === 'querystring').length;
|
|
3
|
+
}
|
|
4
|
+
function reportIfMultipleQuerystring(querystringCount, ctx) {
|
|
5
|
+
const parametersLocation = ctx.location.child('parameters');
|
|
6
|
+
if (querystringCount > 1) {
|
|
7
|
+
ctx.report({
|
|
8
|
+
message: 'Parameters with `in: querystring` should be defined only once per path/operation parameter set.',
|
|
9
|
+
location: parametersLocation,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function checkMixedUsage(parameter, parameterLocation, state, ctx) {
|
|
14
|
+
if (parameter.in === 'query') {
|
|
15
|
+
if (state.querystringLocation) {
|
|
16
|
+
ctx.report({
|
|
17
|
+
message: 'Parameters with `in: query` cannot be used together with `in: querystring` in the same operation/path parameter set.',
|
|
18
|
+
location: parameterLocation,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
state.queryLocation ??= parameterLocation;
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (parameter.in === 'querystring') {
|
|
25
|
+
if (state.queryLocation) {
|
|
26
|
+
ctx.report({
|
|
27
|
+
message: 'Parameters with `in: querystring` cannot be used together with `in: query` in the same operation/path parameter set.',
|
|
28
|
+
location: parameterLocation,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
state.querystringLocation ??= parameterLocation;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export const SpecQuerystringParameters = () => {
|
|
35
|
+
let pathState = {};
|
|
36
|
+
let operationState = {};
|
|
37
|
+
let pathQuerystringCount = 0;
|
|
38
|
+
return {
|
|
39
|
+
PathItem: {
|
|
40
|
+
enter(pathItem, ctx) {
|
|
41
|
+
pathState = {};
|
|
42
|
+
operationState = {};
|
|
43
|
+
pathQuerystringCount = 0;
|
|
44
|
+
reportIfMultipleQuerystring(countQuerystring(pathItem.parameters || []), ctx);
|
|
45
|
+
},
|
|
46
|
+
Parameter(parameter, ctx) {
|
|
47
|
+
checkMixedUsage(parameter, ctx.location, pathState, ctx);
|
|
48
|
+
if (parameter.in === 'querystring') {
|
|
49
|
+
pathQuerystringCount += 1;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
Operation: {
|
|
53
|
+
enter(operation, ctx) {
|
|
54
|
+
operationState = { ...pathState };
|
|
55
|
+
const totalQuerystring = pathQuerystringCount + countQuerystring(operation.parameters || []);
|
|
56
|
+
reportIfMultipleQuerystring(totalQuerystring, ctx);
|
|
57
|
+
},
|
|
58
|
+
Parameter(parameter, ctx) {
|
|
59
|
+
checkMixedUsage(parameter, ctx.location, operationState, ctx);
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=spec-querystring-parameters.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Assertions } from '../common/assertions/index.js';
|
|
2
|
+
import { InfoContact } from '../common/info-contact.js';
|
|
3
|
+
import { InfoLicense } from '../common/info-license.js';
|
|
4
|
+
import { NoUnresolvedRefs } from '../common/no-unresolved-refs.js';
|
|
5
|
+
import { Struct } from '../common/struct.js';
|
|
6
|
+
import { NoUnusedComponents } from './no-unused-components.js';
|
|
7
|
+
import { NoDuplicatedMethodParams } from './spec-no-duplicated-method-params.js';
|
|
8
|
+
import { NoRequiredParamsAfterOptional } from './spec-no-required-params-after-optional.js';
|
|
9
|
+
export const rules = {
|
|
10
|
+
struct: Struct,
|
|
11
|
+
'no-unresolved-refs': NoUnresolvedRefs,
|
|
12
|
+
assertions: Assertions,
|
|
13
|
+
'info-license': InfoLicense,
|
|
14
|
+
'no-unused-components': NoUnusedComponents,
|
|
15
|
+
'info-contact': InfoContact,
|
|
16
|
+
'spec-no-duplicated-method-params': NoDuplicatedMethodParams,
|
|
17
|
+
'spec-no-required-params-after-optional': NoRequiredParamsAfterOptional,
|
|
18
|
+
};
|
|
19
|
+
export const preprocessors = {};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/no-unused-components.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const NoUnusedComponents = () => {
|
|
2
|
+
const components = new Map();
|
|
3
|
+
function registerComponent(location, name) {
|
|
4
|
+
components.set(location.absolutePointer, {
|
|
5
|
+
used: components.get(location.absolutePointer)?.used || false,
|
|
6
|
+
location,
|
|
7
|
+
name,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
ref(ref, { type, resolve, key, location }) {
|
|
12
|
+
if ([
|
|
13
|
+
'Schema',
|
|
14
|
+
'ContentDescriptor',
|
|
15
|
+
'Example',
|
|
16
|
+
'Link',
|
|
17
|
+
'ErrorObject',
|
|
18
|
+
'ExamplePairing',
|
|
19
|
+
'Tag',
|
|
20
|
+
].includes(type.name)) {
|
|
21
|
+
const resolvedRef = resolve(ref);
|
|
22
|
+
if (!resolvedRef.location)
|
|
23
|
+
return;
|
|
24
|
+
components.set(resolvedRef.location.absolutePointer, {
|
|
25
|
+
used: true,
|
|
26
|
+
name: key.toString(),
|
|
27
|
+
location,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
Root: {
|
|
32
|
+
leave(_, { report }) {
|
|
33
|
+
components.forEach((usageInfo) => {
|
|
34
|
+
if (!usageInfo.used) {
|
|
35
|
+
report({
|
|
36
|
+
message: `Component: "${usageInfo.name}" is never used.`,
|
|
37
|
+
location: usageInfo.location.key(),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
NamedSchemas: {
|
|
44
|
+
Schema(schema, { location, key }) {
|
|
45
|
+
if (!schema.allOf) {
|
|
46
|
+
registerComponent(location, key.toString());
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
NamedContentDescriptors: {
|
|
51
|
+
ContentDescriptor(_node, { location, key }) {
|
|
52
|
+
registerComponent(location, key.toString());
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
NamedExamples: {
|
|
56
|
+
Example(_node, { location, key }) {
|
|
57
|
+
registerComponent(location, key.toString());
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
NamedLinks: {
|
|
61
|
+
Link(_node, { location, key }) {
|
|
62
|
+
registerComponent(location, key.toString());
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
NamedErrors: {
|
|
66
|
+
ErrorObject(_node, { location, key }) {
|
|
67
|
+
registerComponent(location, key.toString());
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
NamedExamplePairingObjects: {
|
|
71
|
+
ExamplePairing(_node, { location, key }) {
|
|
72
|
+
registerComponent(location, key.toString());
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
NamedTags: {
|
|
76
|
+
Tag(_node, { location, key }) {
|
|
77
|
+
registerComponent(location, key.toString());
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=no-unused-components.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const NoDuplicatedMethodParams = () => {
|
|
2
|
+
return {
|
|
3
|
+
Method: {
|
|
4
|
+
leave(method, { report, resolve, location }) {
|
|
5
|
+
if (!method.params || !Array.isArray(method.params))
|
|
6
|
+
return;
|
|
7
|
+
const seenParams = new Set();
|
|
8
|
+
method.params.forEach((paramOrRef, index) => {
|
|
9
|
+
const resolved = resolve(paramOrRef);
|
|
10
|
+
if (!resolved.node)
|
|
11
|
+
return;
|
|
12
|
+
const param = resolved.node;
|
|
13
|
+
const paramName = param.name;
|
|
14
|
+
if (!paramName)
|
|
15
|
+
return;
|
|
16
|
+
if (seenParams.has(paramName)) {
|
|
17
|
+
report({
|
|
18
|
+
message: `Parameter names must be unique. Duplicate parameter name '${param.name}' found.`,
|
|
19
|
+
location: location.child([index, 'name']),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
seenParams.add(paramName);
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=spec-no-duplicated-method-params.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const NoRequiredParamsAfterOptional = () => {
|
|
2
|
+
return {
|
|
3
|
+
Method: {
|
|
4
|
+
leave(method, { report, resolve, location }) {
|
|
5
|
+
if (!method.params || !Array.isArray(method.params))
|
|
6
|
+
return;
|
|
7
|
+
let foundOptional = false;
|
|
8
|
+
method.params.forEach((paramOrRef, index) => {
|
|
9
|
+
const resolved = resolve(paramOrRef);
|
|
10
|
+
if (!resolved.node)
|
|
11
|
+
return;
|
|
12
|
+
const param = resolved.node;
|
|
13
|
+
const paramName = param.name;
|
|
14
|
+
if (!paramName)
|
|
15
|
+
return;
|
|
16
|
+
const isRequired = param.required === true;
|
|
17
|
+
if (!isRequired) {
|
|
18
|
+
foundOptional = true;
|
|
19
|
+
}
|
|
20
|
+
else if (foundOptional) {
|
|
21
|
+
report({
|
|
22
|
+
message: `Required parameter '${param.name}' must be positioned before optional parameters.`,
|
|
23
|
+
location: location.child([index, 'name']),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=spec-no-required-params-after-optional.js.map
|