@kubb/agent 4.33.2 → 4.33.3
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 +13 -7
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/node_modules/@babel/runtime/package.json +1 -1
- package/.output/server/node_modules/@readme/openapi-parser/package.json +3 -3
- package/.output/server/node_modules/@redocly/config/lib/asyncapi-config-schema.js +53 -0
- package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +2 -0
- package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +2 -1
- package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +7 -4
- package/.output/server/node_modules/@redocly/config/package.json +2 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +54 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +54 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +1 -1
- package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
- package/.output/server/node_modules/ajv/.runkit_example.js +23 -0
- package/.output/server/node_modules/ajv/LICENSE +22 -0
- package/.output/server/node_modules/ajv/README.md +207 -0
- package/.output/server/node_modules/ajv/dist/2019.d.ts +19 -0
- package/.output/server/node_modules/ajv/dist/2019.js +61 -0
- package/.output/server/node_modules/ajv/dist/2019.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/2020.d.ts +19 -0
- package/.output/server/node_modules/ajv/dist/2020.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/ajv.d.ts +18 -0
- package/.output/server/node_modules/ajv/dist/ajv.js +50 -0
- package/.output/server/node_modules/ajv/dist/ajv.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
- package/.output/server/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/.output/server/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/.output/server/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/errors.d.ts +13 -0
- package/.output/server/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/index.d.ts +80 -0
- package/.output/server/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js +229 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/types.js +14 -0
- package/.output/server/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/names.d.ts +20 -0
- package/.output/server/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
- package/.output/server/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/rules.d.ts +28 -0
- package/.output/server/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/util.d.ts +40 -0
- package/.output/server/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/.output/server/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/core.d.ts +173 -0
- package/.output/server/node_modules/ajv/dist/core.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/jtd.d.ts +47 -0
- package/.output/server/node_modules/ajv/dist/jtd.js +72 -0
- package/.output/server/node_modules/ajv/dist/jtd.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
- package/.output/server/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
- package/.output/server/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
- package/.output/server/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
- package/.output/server/node_modules/ajv/dist/runtime/parseJson.js +185 -0
- package/.output/server/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/runtime/quote.js +30 -0
- package/.output/server/node_modules/ajv/dist/runtime/quote.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/runtime/re2.js +6 -0
- package/.output/server/node_modules/ajv/dist/runtime/re2.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/runtime/timestamp.js +42 -0
- package/.output/server/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/.output/server/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/standalone/index.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/standalone/index.js +90 -0
- package/.output/server/node_modules/ajv/dist/standalone/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
- package/.output/server/node_modules/ajv/dist/standalone/instance.js +35 -0
- package/.output/server/node_modules/ajv/dist/standalone/instance.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/types/index.d.ts +183 -0
- package/.output/server/node_modules/ajv/dist/types/index.js +3 -0
- package/.output/server/node_modules/ajv/dist/types/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
- package/.output/server/node_modules/ajv/dist/types/json-schema.js +3 -0
- package/.output/server/node_modules/ajv/dist/types/json-schema.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
- package/.output/server/node_modules/ajv/dist/types/jtd-schema.js +3 -0
- package/.output/server/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/errors.js +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
- package/.output/server/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/.output/server/node_modules/ajv/lib/2019.ts +81 -0
- package/.output/server/node_modules/ajv/lib/2020.ts +75 -0
- package/.output/server/node_modules/ajv/lib/ajv.ts +70 -0
- package/.output/server/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
- package/.output/server/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
- package/.output/server/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
- package/.output/server/node_modules/ajv/lib/compile/errors.ts +184 -0
- package/.output/server/node_modules/ajv/lib/compile/index.ts +324 -0
- package/.output/server/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
- package/.output/server/node_modules/ajv/lib/compile/jtd/serialize.ts +266 -0
- package/.output/server/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
- package/.output/server/node_modules/ajv/lib/compile/names.ts +27 -0
- package/.output/server/node_modules/ajv/lib/compile/ref_error.ts +13 -0
- package/.output/server/node_modules/ajv/lib/compile/resolve.ts +149 -0
- package/.output/server/node_modules/ajv/lib/compile/rules.ts +50 -0
- package/.output/server/node_modules/ajv/lib/compile/util.ts +213 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/index.ts +582 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
- package/.output/server/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
- package/.output/server/node_modules/ajv/lib/core.ts +891 -0
- package/.output/server/node_modules/ajv/lib/jtd.ts +132 -0
- package/.output/server/node_modules/ajv/lib/refs/data.json +13 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
- package/.output/server/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
- package/.output/server/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
- package/.output/server/node_modules/ajv/lib/runtime/equal.ts +7 -0
- package/.output/server/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
- package/.output/server/node_modules/ajv/lib/runtime/quote.ts +31 -0
- package/.output/server/node_modules/ajv/lib/runtime/re2.ts +6 -0
- package/.output/server/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
- package/.output/server/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
- package/.output/server/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/.output/server/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
- package/.output/server/node_modules/ajv/lib/standalone/index.ts +100 -0
- package/.output/server/node_modules/ajv/lib/standalone/instance.ts +36 -0
- package/.output/server/node_modules/ajv/lib/types/index.ts +244 -0
- package/.output/server/node_modules/ajv/lib/types/json-schema.ts +187 -0
- package/.output/server/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/code.ts +168 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/next.ts +8 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/pattern.ts +28 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
- package/.output/server/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
- package/.output/server/node_modules/ajv/package.json +1 -1
- package/.output/server/node_modules/oas/dist/{chunk-SH63AK3O.js → chunk-5EP6HY2E.js} +159 -70
- package/.output/server/node_modules/oas/dist/{chunk-L3V5TF63.js → chunk-7MARUOFZ.js} +1 -9
- package/.output/server/node_modules/oas/dist/{chunk-BOVZLW7Q.js → chunk-HGVFNEKW.js} +517 -126
- package/.output/server/node_modules/oas/dist/{chunk-JMLIY2LK.js → chunk-LSH3X5NA.js} +124 -191
- package/.output/server/node_modules/oas/dist/{chunk-TTCGKV5E.js → chunk-S27IGTVG.js} +4 -1
- package/.output/server/node_modules/oas/dist/chunk-VA3NKXX7.js +9 -0
- package/.output/server/node_modules/oas/dist/index.js +6 -6
- package/.output/server/node_modules/oas/dist/types.js +1 -5
- package/.output/server/node_modules/oas/dist/utils.js +6 -6
- package/.output/server/node_modules/oas/package.json +8 -6
- package/.output/server/node_modules/oas-normalize/package.json +5 -5
- package/.output/server/package.json +7 -7
- package/package.json +16 -16
- package/.output/server/node_modules/oas/dist/chunk-LV26LN7C.js +0 -27
|
@@ -1,22 +1,127 @@
|
|
|
1
1
|
import {
|
|
2
|
-
findSchemaDefinition,
|
|
3
2
|
supportedMethods
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VA3NKXX7.js";
|
|
5
4
|
import {
|
|
6
5
|
cloneObject,
|
|
6
|
+
dereferenceRef,
|
|
7
|
+
getDereferencingOptions,
|
|
7
8
|
getParametersAsJSONSchema,
|
|
8
9
|
getSchemaVersionString,
|
|
9
10
|
isObject,
|
|
10
11
|
isPrimitive,
|
|
11
12
|
matches_mimetype_default,
|
|
12
13
|
toJSONSchema
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5EP6HY2E.js";
|
|
14
15
|
import {
|
|
15
16
|
getExtension
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-S27IGTVG.js";
|
|
17
18
|
import {
|
|
18
19
|
isRef
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-7MARUOFZ.js";
|
|
21
|
+
|
|
22
|
+
// src/operation/index.ts
|
|
23
|
+
import { $RefParser } from "@apidevtools/json-schema-ref-parser";
|
|
24
|
+
|
|
25
|
+
// src/lib/build-discriminator-one-of.ts
|
|
26
|
+
function hasDiscriminatorWithoutPolymorphism(schema) {
|
|
27
|
+
if (!schema || typeof schema !== "object") return false;
|
|
28
|
+
if (!("discriminator" in schema)) return false;
|
|
29
|
+
if ("oneOf" in schema || "anyOf" in schema) return false;
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
function allOfReferencesSchema(schema, targetSchemaName) {
|
|
33
|
+
if (!schema || typeof schema !== "object") return false;
|
|
34
|
+
if (!("allOf" in schema) || !Array.isArray(schema.allOf)) return false;
|
|
35
|
+
return schema.allOf.some((item) => {
|
|
36
|
+
if (isRef(item)) {
|
|
37
|
+
const refParts = item.$ref.split("/");
|
|
38
|
+
const refSchemaName = refParts[refParts.length - 1];
|
|
39
|
+
return refSchemaName === targetSchemaName;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function findDiscriminatorChildren(api) {
|
|
45
|
+
const childrenMap = /* @__PURE__ */ new Map();
|
|
46
|
+
const invertedChildrenMap = /* @__PURE__ */ new Map();
|
|
47
|
+
if (!api?.components?.schemas || typeof api.components.schemas !== "object") {
|
|
48
|
+
return { children: childrenMap, inverted: invertedChildrenMap };
|
|
49
|
+
}
|
|
50
|
+
const schemas = api.components.schemas;
|
|
51
|
+
const schemaNames = Object.keys(schemas);
|
|
52
|
+
const discriminatorSchemas = schemaNames.filter((name) => {
|
|
53
|
+
return hasDiscriminatorWithoutPolymorphism(schemas[name]);
|
|
54
|
+
});
|
|
55
|
+
for (const baseName of discriminatorSchemas) {
|
|
56
|
+
const baseSchema = schemas[baseName];
|
|
57
|
+
const discriminator = baseSchema.discriminator;
|
|
58
|
+
let childSchemaNames;
|
|
59
|
+
if (discriminator.mapping && typeof discriminator.mapping === "object") {
|
|
60
|
+
const mappingRefs = Object.values(discriminator.mapping);
|
|
61
|
+
if (mappingRefs.length > 0) {
|
|
62
|
+
childSchemaNames = mappingRefs.map((ref) => {
|
|
63
|
+
const parts = ref.split("/");
|
|
64
|
+
return parts[parts.length - 1];
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (!childSchemaNames || childSchemaNames.length === 0) {
|
|
69
|
+
childSchemaNames = schemaNames.filter((name) => {
|
|
70
|
+
if (name === baseName) return false;
|
|
71
|
+
return allOfReferencesSchema(schemas[name], baseName);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (childSchemaNames.length > 0) {
|
|
75
|
+
childrenMap.set(baseName, childSchemaNames);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
for (const [key, values] of childrenMap) {
|
|
79
|
+
for (const value of values) {
|
|
80
|
+
if (invertedChildrenMap.has(value)) {
|
|
81
|
+
invertedChildrenMap.get(value)?.push(key);
|
|
82
|
+
} else {
|
|
83
|
+
invertedChildrenMap.set(value, [key]);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return { children: childrenMap, inverted: invertedChildrenMap };
|
|
88
|
+
}
|
|
89
|
+
function buildDiscriminatorOneOf(api, childrenMap) {
|
|
90
|
+
if (!api?.components?.schemas || typeof api.components.schemas !== "object") {
|
|
91
|
+
return;
|
|
92
|
+
} else if (childrenMap.size === 0) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
for (const [schemaName, childNames] of childrenMap) {
|
|
96
|
+
const schema = api.components.schemas[schemaName];
|
|
97
|
+
if (!schema) continue;
|
|
98
|
+
const oneOf = [];
|
|
99
|
+
for (const childName of childNames) {
|
|
100
|
+
if (api.components.schemas[childName]) {
|
|
101
|
+
oneOf.push(cloneObject(api.components.schemas[childName]));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (oneOf.length > 0) {
|
|
105
|
+
schema.oneOf = oneOf;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
for (const [parentSchemaName, childNames] of childrenMap) {
|
|
109
|
+
for (const childName of childNames) {
|
|
110
|
+
const childSchema = api.components.schemas[childName];
|
|
111
|
+
if (!childSchema || !("allOf" in childSchema) || !Array.isArray(childSchema.allOf)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
for (let i = 0; i < childSchema.allOf.length; i++) {
|
|
115
|
+
const item = childSchema.allOf[i];
|
|
116
|
+
if (item && typeof item === "object" && "x-readme-ref-name" in item && item["x-readme-ref-name"] === parentSchemaName && "oneOf" in item) {
|
|
117
|
+
const clonedItem = cloneObject(item);
|
|
118
|
+
delete clonedItem.oneOf;
|
|
119
|
+
childSchema.allOf[i] = clonedItem;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
20
125
|
|
|
21
126
|
// src/operation/lib/dedupe-common-parameters.ts
|
|
22
127
|
function dedupeCommonParameters(parameters, commonParameters) {
|
|
@@ -251,7 +356,7 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, opts = {}) {
|
|
|
251
356
|
ret.description = description;
|
|
252
357
|
}
|
|
253
358
|
return ret;
|
|
254
|
-
}).filter(
|
|
359
|
+
}).filter((item) => item !== false);
|
|
255
360
|
if (multipleExamples.length) {
|
|
256
361
|
return multipleExamples;
|
|
257
362
|
}
|
|
@@ -271,15 +376,16 @@ function getMediaTypeExamples(mediaType, mediaTypeObject, opts = {}) {
|
|
|
271
376
|
// src/operation/lib/get-response-examples.ts
|
|
272
377
|
function getResponseExamples(operation) {
|
|
273
378
|
return Object.keys(operation.responses || {}).map((status) => {
|
|
274
|
-
const response = operation.responses[status];
|
|
379
|
+
const response = operation.responses?.[status];
|
|
275
380
|
let onlyHeaders = false;
|
|
276
|
-
if (isRef(response)) {
|
|
381
|
+
if (!response || isRef(response)) {
|
|
277
382
|
return false;
|
|
278
383
|
}
|
|
279
384
|
const mediaTypes = {};
|
|
280
|
-
(response
|
|
385
|
+
(response?.content ? Object.keys(response.content) : []).forEach((mediaType) => {
|
|
281
386
|
if (!mediaType) return;
|
|
282
|
-
const mediaTypeObject = response.content[mediaType];
|
|
387
|
+
const mediaTypeObject = response.content?.[mediaType];
|
|
388
|
+
if (!mediaTypeObject) return;
|
|
283
389
|
const examples = getMediaTypeExamples(mediaType, mediaTypeObject, {
|
|
284
390
|
includeReadOnly: true,
|
|
285
391
|
includeWriteOnly: false
|
|
@@ -300,32 +406,35 @@ function getResponseExamples(operation) {
|
|
|
300
406
|
mediaTypes,
|
|
301
407
|
...onlyHeaders ? { onlyHeaders } : {}
|
|
302
408
|
};
|
|
303
|
-
}).filter(
|
|
409
|
+
}).filter((item) => item !== false);
|
|
304
410
|
}
|
|
305
411
|
|
|
306
412
|
// src/operation/lib/get-callback-examples.ts
|
|
307
413
|
function getCallbackExamples(operation) {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
414
|
+
if (!operation.callbacks) {
|
|
415
|
+
return [];
|
|
416
|
+
}
|
|
417
|
+
const examples = Object.keys(operation.callbacks).map((identifier) => {
|
|
418
|
+
const callback = operation.callbacks?.[identifier];
|
|
419
|
+
if (!callback || isRef(callback)) {
|
|
420
|
+
return [];
|
|
421
|
+
}
|
|
422
|
+
const items = Object.keys(callback).map((expression) => {
|
|
423
|
+
return Object.keys(callback[expression]).map((method) => {
|
|
424
|
+
const pathItem = callback[expression];
|
|
425
|
+
const example = getResponseExamples(pathItem[method]);
|
|
426
|
+
if (example.length === 0) return false;
|
|
427
|
+
return {
|
|
428
|
+
identifier,
|
|
429
|
+
expression,
|
|
430
|
+
method,
|
|
431
|
+
example
|
|
432
|
+
};
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
return items.flat().filter((item) => item !== false);
|
|
436
|
+
});
|
|
437
|
+
return examples.flat();
|
|
329
438
|
}
|
|
330
439
|
|
|
331
440
|
// src/operation/lib/get-example-groups.ts
|
|
@@ -341,7 +450,7 @@ function addMatchingResponseExamples(groups, operation) {
|
|
|
341
450
|
status: example.status
|
|
342
451
|
};
|
|
343
452
|
if (!groups[mediaTypeExample.title].name) {
|
|
344
|
-
groups[mediaTypeExample.title].name = mediaTypeExample.summary;
|
|
453
|
+
groups[mediaTypeExample.title].name = mediaTypeExample.summary || mediaTypeExample.title;
|
|
345
454
|
}
|
|
346
455
|
}
|
|
347
456
|
});
|
|
@@ -362,13 +471,15 @@ function getExampleGroups(operation) {
|
|
|
362
471
|
namelessCodeSampleCounts[sample.language] = 1;
|
|
363
472
|
}
|
|
364
473
|
const name = getDefaultName(sample, namelessCodeSampleCounts);
|
|
365
|
-
if (
|
|
366
|
-
groups[sample.correspondingExample]
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
474
|
+
if (sample.correspondingExample) {
|
|
475
|
+
if (groups[sample.correspondingExample]?.customCodeSamples?.length) {
|
|
476
|
+
groups[sample.correspondingExample].customCodeSamples.push({ ...sample, name, originalIndex: i });
|
|
477
|
+
} else if (sample.correspondingExample) {
|
|
478
|
+
groups[sample.correspondingExample] = {
|
|
479
|
+
name,
|
|
480
|
+
customCodeSamples: [{ ...sample, name, originalIndex: i }]
|
|
481
|
+
};
|
|
482
|
+
}
|
|
372
483
|
} else if (groups[noCorrespondingResponseKey]?.customCodeSamples?.length) {
|
|
373
484
|
groups[noCorrespondingResponseKey].customCodeSamples.push({ ...sample, name, originalIndex: i });
|
|
374
485
|
} else {
|
|
@@ -384,9 +495,12 @@ function getExampleGroups(operation) {
|
|
|
384
495
|
}
|
|
385
496
|
operation.getParameters().forEach((param) => {
|
|
386
497
|
Object.entries(param.examples || {}).forEach(([exampleKey, paramExample]) => {
|
|
498
|
+
if (isRef(paramExample)) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
387
501
|
groups[exampleKey] = {
|
|
388
502
|
...groups[exampleKey],
|
|
389
|
-
name: groups[exampleKey]?.name || paramExample.summary,
|
|
503
|
+
name: groups[exampleKey]?.name || paramExample.summary || exampleKey,
|
|
390
504
|
request: {
|
|
391
505
|
...groups[exampleKey]?.request,
|
|
392
506
|
[param.in]: {
|
|
@@ -403,7 +517,7 @@ function getExampleGroups(operation) {
|
|
|
403
517
|
const mediaType = requestExample.mediaType === "application/x-www-form-urlencoded" ? "formData" : "body";
|
|
404
518
|
groups[mediaTypeExample.title] = {
|
|
405
519
|
...groups[mediaTypeExample.title],
|
|
406
|
-
name: groups[mediaTypeExample.title]?.name || mediaTypeExample.summary,
|
|
520
|
+
name: groups[mediaTypeExample.title]?.name || mediaTypeExample.summary || mediaTypeExample.title,
|
|
407
521
|
request: {
|
|
408
522
|
...groups[mediaTypeExample.title]?.request,
|
|
409
523
|
[mediaType]: mediaTypeExample.value
|
|
@@ -426,7 +540,7 @@ function getExampleGroups(operation) {
|
|
|
426
540
|
// src/operation/lib/get-requestbody-examples.ts
|
|
427
541
|
function getRequestBodyExamples(operation) {
|
|
428
542
|
const requestBody = operation.requestBody;
|
|
429
|
-
if (!requestBody || !requestBody.content) {
|
|
543
|
+
if (!requestBody || isRef(requestBody) || !requestBody.content) {
|
|
430
544
|
return [];
|
|
431
545
|
}
|
|
432
546
|
return Object.keys(requestBody.content || {}).map((mediaType) => {
|
|
@@ -442,29 +556,36 @@ function getRequestBodyExamples(operation) {
|
|
|
442
556
|
mediaType,
|
|
443
557
|
examples
|
|
444
558
|
};
|
|
445
|
-
}).filter((
|
|
559
|
+
}).filter((item) => item !== false);
|
|
446
560
|
}
|
|
447
561
|
|
|
448
562
|
// src/operation/lib/get-response-as-json-schema.ts
|
|
449
563
|
var isJSON = matches_mimetype_default.json;
|
|
450
564
|
function buildHeadersSchema(response, opts) {
|
|
451
|
-
const headers = response.headers;
|
|
452
565
|
const headersSchema = {
|
|
453
566
|
type: "object",
|
|
454
567
|
properties: {}
|
|
455
568
|
};
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
addEnumsToDescriptions: true,
|
|
461
|
-
transformer: opts.transformer
|
|
462
|
-
});
|
|
463
|
-
if (header.description) {
|
|
464
|
-
headersSchema.properties[key].description = header.description;
|
|
569
|
+
if (response.headers) {
|
|
570
|
+
Object.keys(response.headers).forEach((key) => {
|
|
571
|
+
if (!response.headers?.[key] || isRef(response.headers?.[key])) {
|
|
572
|
+
return;
|
|
465
573
|
}
|
|
466
|
-
|
|
467
|
-
|
|
574
|
+
if (response.headers[key].schema) {
|
|
575
|
+
const header = response.headers[key];
|
|
576
|
+
if (!header.schema || isRef(header.schema)) {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
headersSchema.properties[key] = toJSONSchema(header.schema, {
|
|
580
|
+
addEnumsToDescriptions: true,
|
|
581
|
+
transformer: opts?.transformer
|
|
582
|
+
});
|
|
583
|
+
if (header.description) {
|
|
584
|
+
headersSchema.properties[key].description = header.description;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
}
|
|
468
589
|
const headersWrapper = {
|
|
469
590
|
schema: headersSchema,
|
|
470
591
|
type: "object",
|
|
@@ -500,28 +621,43 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
500
621
|
}
|
|
501
622
|
if (preferredContentType) {
|
|
502
623
|
if (contentTypes.includes(preferredContentType)) {
|
|
503
|
-
|
|
624
|
+
const schema2 = cloneObject(content[preferredContentType].schema);
|
|
625
|
+
if (!schema2) {
|
|
626
|
+
return null;
|
|
627
|
+
}
|
|
628
|
+
return toJSONSchema(schema2, {
|
|
504
629
|
addEnumsToDescriptions: true,
|
|
505
630
|
refLogger,
|
|
506
|
-
transformer: opts
|
|
631
|
+
transformer: opts?.transformer
|
|
507
632
|
});
|
|
508
633
|
}
|
|
509
634
|
return null;
|
|
510
635
|
}
|
|
511
636
|
for (let i = 0; i < contentTypes.length; i++) {
|
|
512
637
|
if (isJSON(contentTypes[i])) {
|
|
513
|
-
|
|
638
|
+
const schema2 = cloneObject(content[contentTypes[i]].schema);
|
|
639
|
+
if (!schema2) {
|
|
640
|
+
return {};
|
|
641
|
+
}
|
|
642
|
+
return toJSONSchema(schema2, {
|
|
514
643
|
addEnumsToDescriptions: true,
|
|
515
644
|
refLogger,
|
|
516
|
-
transformer: opts
|
|
645
|
+
transformer: opts?.transformer
|
|
517
646
|
});
|
|
518
647
|
}
|
|
519
648
|
}
|
|
520
649
|
const contentType = contentTypes.shift();
|
|
521
|
-
|
|
650
|
+
if (!contentType) {
|
|
651
|
+
return {};
|
|
652
|
+
}
|
|
653
|
+
const schema = cloneObject(content[contentType].schema);
|
|
654
|
+
if (!schema) {
|
|
655
|
+
return {};
|
|
656
|
+
}
|
|
657
|
+
return toJSONSchema(schema, {
|
|
522
658
|
addEnumsToDescriptions: true,
|
|
523
659
|
refLogger,
|
|
524
|
-
transformer: opts
|
|
660
|
+
transformer: opts?.transformer
|
|
525
661
|
});
|
|
526
662
|
}
|
|
527
663
|
const foundSchema = getPreferredSchema(response.content, opts?.contentType);
|
|
@@ -545,8 +681,10 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
545
681
|
schemaWrapper.description = response.description;
|
|
546
682
|
}
|
|
547
683
|
if (api.components && schemaWrapper.schema) {
|
|
548
|
-
if (hasCircularRefs || hasDiscriminatorMappingRefs && opts
|
|
549
|
-
schemaWrapper.schema.components =
|
|
684
|
+
if (hasCircularRefs || hasDiscriminatorMappingRefs && opts?.includeDiscriminatorMappingRefs) {
|
|
685
|
+
schemaWrapper.schema.components = cloneObject(
|
|
686
|
+
api.components
|
|
687
|
+
);
|
|
550
688
|
}
|
|
551
689
|
}
|
|
552
690
|
jsonSchema.push(schemaWrapper);
|
|
@@ -559,7 +697,7 @@ function getResponseAsJSONSchema(operation, api, statusCode, opts) {
|
|
|
559
697
|
|
|
560
698
|
// src/operation/lib/operationId.ts
|
|
561
699
|
function hasOperationId(operation) {
|
|
562
|
-
return Boolean("operationId" in operation && operation.operationId
|
|
700
|
+
return Boolean("operationId" in operation && operation.operationId?.length);
|
|
563
701
|
}
|
|
564
702
|
function getOperationId(path, method, operation, opts = {}) {
|
|
565
703
|
function sanitize(id) {
|
|
@@ -642,6 +780,17 @@ var Operation = class {
|
|
|
642
780
|
* Flattened out arrays of both request and response headers that are utilized on this operation.
|
|
643
781
|
*/
|
|
644
782
|
headers;
|
|
783
|
+
/**
|
|
784
|
+
* Internal storage array that the library utilizes to keep track of the times the
|
|
785
|
+
* {@see Operation.dereference} has been called so that if you initiate multiple promises they'll
|
|
786
|
+
* all end up returning the same data set once the initial dereference call completed.
|
|
787
|
+
*/
|
|
788
|
+
promises;
|
|
789
|
+
/**
|
|
790
|
+
* Internal storage array that the library utilizes to keep track of its `dereferencing` state so
|
|
791
|
+
* it doesn't initiate multiple dereferencing processes.
|
|
792
|
+
*/
|
|
793
|
+
dereferencing;
|
|
645
794
|
constructor(api, path, method, operation) {
|
|
646
795
|
this.schema = operation;
|
|
647
796
|
this.api = api;
|
|
@@ -656,33 +805,62 @@ var Operation = class {
|
|
|
656
805
|
request: [],
|
|
657
806
|
response: []
|
|
658
807
|
};
|
|
808
|
+
this.promises = [];
|
|
809
|
+
this.dereferencing = {
|
|
810
|
+
processing: false,
|
|
811
|
+
complete: false,
|
|
812
|
+
circularRefs: []
|
|
813
|
+
};
|
|
659
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* Retrieve the `summary` for this operation.
|
|
817
|
+
*
|
|
818
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationsummary}
|
|
819
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-summary}
|
|
820
|
+
*/
|
|
660
821
|
getSummary() {
|
|
661
822
|
if (this.schema?.summary && typeof this.schema.summary === "string") {
|
|
662
823
|
return this.schema.summary;
|
|
663
|
-
}
|
|
664
|
-
|
|
824
|
+
}
|
|
825
|
+
const pathItem = this.api.paths?.[this.path];
|
|
826
|
+
if (pathItem?.summary && typeof pathItem.summary === "string") {
|
|
827
|
+
return pathItem.summary;
|
|
665
828
|
}
|
|
666
829
|
return void 0;
|
|
667
830
|
}
|
|
831
|
+
/**
|
|
832
|
+
* Retrieve the `description` for this operation.
|
|
833
|
+
*
|
|
834
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationdescription}
|
|
835
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-description}
|
|
836
|
+
*/
|
|
668
837
|
getDescription() {
|
|
669
838
|
if (this.schema?.description && typeof this.schema.description === "string") {
|
|
670
839
|
return this.schema.description;
|
|
671
|
-
}
|
|
672
|
-
|
|
840
|
+
}
|
|
841
|
+
const pathItem = this.api.paths?.[this.path];
|
|
842
|
+
if (pathItem?.description && typeof pathItem.description === "string") {
|
|
843
|
+
return pathItem.description;
|
|
673
844
|
}
|
|
674
845
|
return void 0;
|
|
675
846
|
}
|
|
847
|
+
/**
|
|
848
|
+
* Retrieve the primary content type for this operation. If multiple exist, the first JSON-like
|
|
849
|
+
* type will be returned.
|
|
850
|
+
*
|
|
851
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-requestbodycontent}
|
|
852
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
853
|
+
*/
|
|
676
854
|
getContentType() {
|
|
677
855
|
if (this.contentType) {
|
|
678
856
|
return this.contentType;
|
|
679
857
|
}
|
|
680
858
|
let types = [];
|
|
681
859
|
if (this.schema.requestBody) {
|
|
682
|
-
if (
|
|
683
|
-
this.schema.requestBody =
|
|
860
|
+
if (isRef(this.schema.requestBody)) {
|
|
861
|
+
this.schema.requestBody = dereferenceRef(this.schema.requestBody, this.api);
|
|
684
862
|
}
|
|
685
|
-
if ("content" in this.schema.requestBody) {
|
|
863
|
+
if (this.schema.requestBody && "content" in this.schema.requestBody) {
|
|
686
864
|
types = Object.keys(this.schema.requestBody.content);
|
|
687
865
|
}
|
|
688
866
|
}
|
|
@@ -697,21 +875,46 @@ var Operation = class {
|
|
|
697
875
|
});
|
|
698
876
|
return this.contentType;
|
|
699
877
|
}
|
|
878
|
+
/**
|
|
879
|
+
* Checks if the current operation has a `x-www-form-urlencoded` content type payload.
|
|
880
|
+
*
|
|
881
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-requestbodycontent}
|
|
882
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
883
|
+
*/
|
|
700
884
|
isFormUrlEncoded() {
|
|
701
885
|
return matches_mimetype_default.formUrlEncoded(this.getContentType());
|
|
702
886
|
}
|
|
887
|
+
/**
|
|
888
|
+
* Checks if the current operation has a mutipart content type payload.
|
|
889
|
+
*
|
|
890
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-requestbodycontent}
|
|
891
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
892
|
+
*/
|
|
703
893
|
isMultipart() {
|
|
704
894
|
return matches_mimetype_default.multipart(this.getContentType());
|
|
705
895
|
}
|
|
896
|
+
/**
|
|
897
|
+
* Checks if the current operation has a JSON-like content type payload.
|
|
898
|
+
*
|
|
899
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-requestbodycontent}
|
|
900
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
901
|
+
*/
|
|
706
902
|
isJson() {
|
|
707
903
|
return matches_mimetype_default.json(this.getContentType());
|
|
708
904
|
}
|
|
905
|
+
/**
|
|
906
|
+
* Checks if the current operation has an XML content type payload.
|
|
907
|
+
*
|
|
908
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-requestbodycontent}
|
|
909
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-request-body-content}
|
|
910
|
+
*/
|
|
709
911
|
isXml() {
|
|
710
912
|
return matches_mimetype_default.xml(this.getContentType());
|
|
711
913
|
}
|
|
712
914
|
/**
|
|
713
915
|
* Checks if the current operation is a webhook or not.
|
|
714
916
|
*
|
|
917
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#oas-webhooks}
|
|
715
918
|
*/
|
|
716
919
|
isWebhook() {
|
|
717
920
|
return this instanceof Webhook;
|
|
@@ -721,6 +924,8 @@ var Operation = class {
|
|
|
721
924
|
* defined at the operation level, the securities for the entire API definition are returned
|
|
722
925
|
* (with an empty array as a final fallback).
|
|
723
926
|
*
|
|
927
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object}
|
|
928
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#security-requirement-object}
|
|
724
929
|
*/
|
|
725
930
|
getSecurity() {
|
|
726
931
|
if (!this.api?.components?.securitySchemes || !Object.keys(this.api.components.securitySchemes).length) {
|
|
@@ -739,8 +944,7 @@ var Operation = class {
|
|
|
739
944
|
* security schemes, rather than returning `false`.
|
|
740
945
|
*/
|
|
741
946
|
getSecurityWithTypes(filterInvalid = false) {
|
|
742
|
-
|
|
743
|
-
return securityRequirements.map((requirement) => {
|
|
947
|
+
return this.getSecurity().map((requirement) => {
|
|
744
948
|
let keys;
|
|
745
949
|
try {
|
|
746
950
|
keys = Object.keys(requirement);
|
|
@@ -750,6 +954,9 @@ var Operation = class {
|
|
|
750
954
|
const keysWithTypes = keys.map((key) => {
|
|
751
955
|
let security;
|
|
752
956
|
try {
|
|
957
|
+
if (!this.api.components?.securitySchemes?.[key] || isRef(this.api.components.securitySchemes[key])) {
|
|
958
|
+
return false;
|
|
959
|
+
}
|
|
753
960
|
security = this.api.components.securitySchemes[key];
|
|
754
961
|
} catch {
|
|
755
962
|
return false;
|
|
@@ -789,8 +996,7 @@ var Operation = class {
|
|
|
789
996
|
*
|
|
790
997
|
*/
|
|
791
998
|
prepareSecurity() {
|
|
792
|
-
|
|
793
|
-
return securitiesWithTypes.reduce(
|
|
999
|
+
return this.getSecurityWithTypes().reduce(
|
|
794
1000
|
(prev, securities) => {
|
|
795
1001
|
if (!securities) return prev;
|
|
796
1002
|
securities.forEach((security) => {
|
|
@@ -807,12 +1013,17 @@ var Operation = class {
|
|
|
807
1013
|
{}
|
|
808
1014
|
);
|
|
809
1015
|
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Retrieve all of the headers, request and response, that are associated with this operation.
|
|
1018
|
+
*
|
|
1019
|
+
*/
|
|
810
1020
|
getHeaders() {
|
|
811
1021
|
const security = this.prepareSecurity();
|
|
812
1022
|
if (security.Header) {
|
|
813
1023
|
this.headers.request = security.Header.map((h) => {
|
|
1024
|
+
if (!("name" in h)) return false;
|
|
814
1025
|
return h.name;
|
|
815
|
-
});
|
|
1026
|
+
}).filter((item) => item !== false);
|
|
816
1027
|
}
|
|
817
1028
|
if (security.Bearer || security.Basic || security.OAuth2) {
|
|
818
1029
|
this.headers.request.push("Authorization");
|
|
@@ -822,30 +1033,38 @@ var Operation = class {
|
|
|
822
1033
|
}
|
|
823
1034
|
if (this.schema.parameters) {
|
|
824
1035
|
this.headers.request = this.headers.request.concat(
|
|
825
|
-
// Remove the reference object because we will have already dereferenced.
|
|
826
1036
|
this.schema.parameters.map((p) => {
|
|
1037
|
+
if (isRef(p)) {
|
|
1038
|
+
return void 0;
|
|
1039
|
+
}
|
|
827
1040
|
if (p.in && p.in === "header") return p.name;
|
|
828
1041
|
return void 0;
|
|
829
|
-
}).filter((
|
|
1042
|
+
}).filter((item) => item !== void 0)
|
|
830
1043
|
);
|
|
831
1044
|
}
|
|
832
1045
|
if (this.schema.responses) {
|
|
833
|
-
this.headers.response = Object.keys(this.schema.responses).
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1046
|
+
this.headers.response = Object.keys(this.schema.responses).map((r) => {
|
|
1047
|
+
const response = this.schema.responses?.[r];
|
|
1048
|
+
if (!response || isRef(response)) {
|
|
1049
|
+
return [];
|
|
1050
|
+
}
|
|
1051
|
+
return response?.headers ? Object.keys(response.headers) : [];
|
|
1052
|
+
}).reduce((a, b) => a.concat(b), []);
|
|
839
1053
|
}
|
|
840
1054
|
if (!this.headers.request.includes("Content-Type") && this.schema.requestBody) {
|
|
841
|
-
|
|
1055
|
+
const requestBody = this.schema.requestBody;
|
|
1056
|
+
if (requestBody && !isRef(requestBody) && "content" in requestBody && Object.keys(requestBody.content)) {
|
|
842
1057
|
this.headers.request.push("Content-Type");
|
|
843
1058
|
}
|
|
844
1059
|
}
|
|
845
1060
|
if (this.schema.responses) {
|
|
846
|
-
if (Object.keys(this.schema.responses).some(
|
|
847
|
-
|
|
848
|
-
|
|
1061
|
+
if (Object.keys(this.schema.responses).some((r) => {
|
|
1062
|
+
const response = this.schema.responses?.[r];
|
|
1063
|
+
if (!response || isRef(response)) {
|
|
1064
|
+
return false;
|
|
1065
|
+
}
|
|
1066
|
+
return response?.content && Object.keys(response.content).length > 0;
|
|
1067
|
+
})) {
|
|
849
1068
|
if (!this.headers.request.includes("Accept")) this.headers.request.push("Accept");
|
|
850
1069
|
if (!this.headers.response.includes("Content-Type")) this.headers.response.push("Content-Type");
|
|
851
1070
|
}
|
|
@@ -853,17 +1072,21 @@ var Operation = class {
|
|
|
853
1072
|
return this.headers;
|
|
854
1073
|
}
|
|
855
1074
|
/**
|
|
856
|
-
* Determine if
|
|
857
|
-
* present in the schema but is an empty string then this will return false
|
|
1075
|
+
* Determine if this operation has an `operationId` present in its schema. Note that if one is
|
|
1076
|
+
* present in the schema but is an empty string then this will return `false`.
|
|
858
1077
|
*
|
|
1078
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationid}
|
|
1079
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-id}
|
|
859
1080
|
*/
|
|
860
1081
|
hasOperationId() {
|
|
861
1082
|
return hasOperationId(this.schema);
|
|
862
1083
|
}
|
|
863
1084
|
/**
|
|
864
1085
|
* Determine if an operation has an `operationId` present in its schema. Note that if one is
|
|
865
|
-
* present in the schema but is an empty string then this will return false
|
|
1086
|
+
* present in the schema but is an empty string then this will return `false`.
|
|
866
1087
|
*
|
|
1088
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationid}
|
|
1089
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-id}
|
|
867
1090
|
*/
|
|
868
1091
|
static hasOperationId(schema) {
|
|
869
1092
|
return hasOperationId(schema);
|
|
@@ -872,6 +1095,8 @@ var Operation = class {
|
|
|
872
1095
|
* Get an `operationId` for this operation. If one is not present (it's not required by the spec!)
|
|
873
1096
|
* a hash of the path and method will be returned instead.
|
|
874
1097
|
*
|
|
1098
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationid}
|
|
1099
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-id}
|
|
875
1100
|
*/
|
|
876
1101
|
getOperationId(opts = {}) {
|
|
877
1102
|
return getOperationId(this.path, this.method, this.schema, opts);
|
|
@@ -880,6 +1105,8 @@ var Operation = class {
|
|
|
880
1105
|
* Get an `operationId` for an operation. If one is not present (it's not required by the spec!)
|
|
881
1106
|
* a hash of the path and method will be returned instead.
|
|
882
1107
|
*
|
|
1108
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationid}
|
|
1109
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-id}
|
|
883
1110
|
*/
|
|
884
1111
|
static getOperationId(path, method, schema, opts = {}) {
|
|
885
1112
|
return getOperationId(path, method, schema, opts);
|
|
@@ -893,7 +1120,7 @@ var Operation = class {
|
|
|
893
1120
|
return [];
|
|
894
1121
|
}
|
|
895
1122
|
const oasTagMap = /* @__PURE__ */ new Map();
|
|
896
|
-
if (
|
|
1123
|
+
if (Array.isArray(this.api?.tags)) {
|
|
897
1124
|
this.api.tags.forEach((tag) => {
|
|
898
1125
|
oasTagMap.set(tag.name, tag);
|
|
899
1126
|
});
|
|
@@ -916,9 +1143,11 @@ var Operation = class {
|
|
|
916
1143
|
/**
|
|
917
1144
|
* Return is the operation is flagged as `deprecated` or not.
|
|
918
1145
|
*
|
|
1146
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationdeprecated}
|
|
1147
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-deprecated}
|
|
919
1148
|
*/
|
|
920
1149
|
isDeprecated() {
|
|
921
|
-
return "deprecated" in this.schema ? this.schema.deprecated : false;
|
|
1150
|
+
return Boolean("deprecated" in this.schema ? this.schema.deprecated : false);
|
|
922
1151
|
}
|
|
923
1152
|
/**
|
|
924
1153
|
* Determine if the operation has any (non-request body) parameters.
|
|
@@ -930,10 +1159,17 @@ var Operation = class {
|
|
|
930
1159
|
/**
|
|
931
1160
|
* Return the parameters (non-request body) on the operation.
|
|
932
1161
|
*
|
|
1162
|
+
* @todo Add support for `ReferenceObject`
|
|
1163
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationparameters}
|
|
1164
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
933
1165
|
*/
|
|
934
1166
|
getParameters() {
|
|
935
|
-
let parameters = this.schema?.parameters || []
|
|
936
|
-
|
|
1167
|
+
let parameters = (this.schema?.parameters || []).filter(
|
|
1168
|
+
(param) => param && !isRef(param)
|
|
1169
|
+
);
|
|
1170
|
+
const commonParams = (this.api?.paths?.[this.path]?.parameters || []).filter(
|
|
1171
|
+
(param) => param && !isRef(param)
|
|
1172
|
+
);
|
|
937
1173
|
if (commonParams.length) {
|
|
938
1174
|
parameters = parameters.concat(dedupeCommonParameters(parameters, commonParams) || []);
|
|
939
1175
|
}
|
|
@@ -942,6 +1178,8 @@ var Operation = class {
|
|
|
942
1178
|
/**
|
|
943
1179
|
* Determine if this operation has any required parameters.
|
|
944
1180
|
*
|
|
1181
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationparameters}
|
|
1182
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-parameters}
|
|
945
1183
|
*/
|
|
946
1184
|
hasRequiredParameters() {
|
|
947
1185
|
return this.getParameters().some((param) => "required" in param && param.required);
|
|
@@ -983,6 +1221,8 @@ var Operation = class {
|
|
|
983
1221
|
/**
|
|
984
1222
|
* Determine if the operation has any request bodies.
|
|
985
1223
|
*
|
|
1224
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#user-content-operationrequestbody}
|
|
1225
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#user-content-operation-request-body}
|
|
986
1226
|
*/
|
|
987
1227
|
hasRequestBody() {
|
|
988
1228
|
return !!this.schema.requestBody;
|
|
@@ -998,7 +1238,7 @@ var Operation = class {
|
|
|
998
1238
|
return [];
|
|
999
1239
|
}
|
|
1000
1240
|
const requestBody = this.schema.requestBody;
|
|
1001
|
-
if (isRef(requestBody)) {
|
|
1241
|
+
if (!requestBody || isRef(requestBody)) {
|
|
1002
1242
|
return [];
|
|
1003
1243
|
}
|
|
1004
1244
|
return Object.keys(requestBody.content);
|
|
@@ -1006,19 +1246,25 @@ var Operation = class {
|
|
|
1006
1246
|
/**
|
|
1007
1247
|
* Determine if this operation has a required request body.
|
|
1008
1248
|
*
|
|
1249
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object}
|
|
1250
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object}
|
|
1009
1251
|
*/
|
|
1010
1252
|
hasRequiredRequestBody() {
|
|
1011
1253
|
if (!this.hasRequestBody()) {
|
|
1012
1254
|
return false;
|
|
1013
1255
|
}
|
|
1014
1256
|
const requestBody = this.schema.requestBody;
|
|
1015
|
-
if (isRef(requestBody)) {
|
|
1257
|
+
if (!requestBody || isRef(requestBody)) {
|
|
1016
1258
|
return false;
|
|
1017
1259
|
}
|
|
1018
1260
|
if (requestBody.required) {
|
|
1019
1261
|
return true;
|
|
1020
1262
|
}
|
|
1021
|
-
|
|
1263
|
+
const parameters = this.getParametersAsJSONSchema();
|
|
1264
|
+
if (parameters === null) {
|
|
1265
|
+
return false;
|
|
1266
|
+
}
|
|
1267
|
+
return !!parameters.filter((js) => ["body", "formData"].includes(js.type)).find((js) => js.schema && Array.isArray(js.schema.required) && js.schema.required.length);
|
|
1022
1268
|
}
|
|
1023
1269
|
/**
|
|
1024
1270
|
* Retrieve a specific request body content schema off this operation.
|
|
@@ -1037,7 +1283,7 @@ var Operation = class {
|
|
|
1037
1283
|
return false;
|
|
1038
1284
|
}
|
|
1039
1285
|
const requestBody = this.schema.requestBody;
|
|
1040
|
-
if (isRef(requestBody)) {
|
|
1286
|
+
if (!requestBody || isRef(requestBody)) {
|
|
1041
1287
|
return false;
|
|
1042
1288
|
}
|
|
1043
1289
|
if (mediaType) {
|
|
@@ -1072,6 +1318,8 @@ var Operation = class {
|
|
|
1072
1318
|
/**
|
|
1073
1319
|
* Retrieve an array of request body examples that this operation has.
|
|
1074
1320
|
*
|
|
1321
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-examples}
|
|
1322
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#request-body-examples}
|
|
1075
1323
|
*/
|
|
1076
1324
|
getRequestBodyExamples() {
|
|
1077
1325
|
const isRequestExampleValueDefined = typeof this.requestBodyExamples?.[0]?.examples?.[0].value !== "undefined";
|
|
@@ -1085,16 +1333,15 @@ var Operation = class {
|
|
|
1085
1333
|
* Return a specific response out of the operation by a given HTTP status code.
|
|
1086
1334
|
*
|
|
1087
1335
|
* @param statusCode Status code to pull a response object for.
|
|
1336
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-object}
|
|
1337
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#response-object}
|
|
1088
1338
|
*/
|
|
1089
1339
|
getResponseByStatusCode(statusCode) {
|
|
1090
1340
|
if (!this.schema.responses) {
|
|
1091
1341
|
return false;
|
|
1092
1342
|
}
|
|
1093
|
-
if (typeof this.schema.responses[statusCode] === "undefined") {
|
|
1094
|
-
return false;
|
|
1095
|
-
}
|
|
1096
1343
|
const response = this.schema.responses[statusCode];
|
|
1097
|
-
if (isRef(response)) {
|
|
1344
|
+
if (!response || isRef(response)) {
|
|
1098
1345
|
return false;
|
|
1099
1346
|
}
|
|
1100
1347
|
return response;
|
|
@@ -1102,6 +1349,8 @@ var Operation = class {
|
|
|
1102
1349
|
/**
|
|
1103
1350
|
* Retrieve an array of response examples that this operation has.
|
|
1104
1351
|
*
|
|
1352
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-object-examples}
|
|
1353
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#response-object-examples}
|
|
1105
1354
|
*/
|
|
1106
1355
|
getResponseExamples() {
|
|
1107
1356
|
if (this.responseExamples) {
|
|
@@ -1113,9 +1362,11 @@ var Operation = class {
|
|
|
1113
1362
|
/**
|
|
1114
1363
|
* Determine if the operation has callbacks.
|
|
1115
1364
|
*
|
|
1365
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
|
|
1366
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
|
|
1116
1367
|
*/
|
|
1117
1368
|
hasCallbacks() {
|
|
1118
|
-
return
|
|
1369
|
+
return Boolean(this.schema.callbacks);
|
|
1119
1370
|
}
|
|
1120
1371
|
/**
|
|
1121
1372
|
* Retrieve a specific callback.
|
|
@@ -1128,36 +1379,51 @@ var Operation = class {
|
|
|
1128
1379
|
*/
|
|
1129
1380
|
getCallback(identifier, expression, method) {
|
|
1130
1381
|
if (!this.schema.callbacks) return false;
|
|
1131
|
-
const
|
|
1132
|
-
if (!
|
|
1382
|
+
const callbackObj = this.schema.callbacks[identifier];
|
|
1383
|
+
if (!callbackObj || isRef(callbackObj)) {
|
|
1384
|
+
return false;
|
|
1385
|
+
}
|
|
1386
|
+
const callback = callbackObj[expression];
|
|
1387
|
+
if (!callback || isRef(callback) || !callback[method]) {
|
|
1388
|
+
return false;
|
|
1389
|
+
}
|
|
1133
1390
|
return new Callback(this.api, expression, method, callback[method], identifier, callback);
|
|
1134
1391
|
}
|
|
1135
1392
|
/**
|
|
1136
1393
|
* Retrieve an array of operations created from each callback.
|
|
1137
1394
|
*
|
|
1395
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
|
|
1396
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
|
|
1138
1397
|
*/
|
|
1139
1398
|
getCallbacks() {
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
Object.keys(this.schema.callbacks).forEach((callback) => {
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1399
|
+
if (!this.hasCallbacks()) return [];
|
|
1400
|
+
const callbacks = [];
|
|
1401
|
+
Object.keys(this.schema.callbacks || {}).forEach((callback) => {
|
|
1402
|
+
const cb = this.schema.callbacks?.[callback];
|
|
1403
|
+
if (!cb || isRef(cb)) {
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1406
|
+
Object.keys(cb).forEach((expression) => {
|
|
1407
|
+
const exp = cb[expression];
|
|
1408
|
+
if (!exp || isRef(exp)) {
|
|
1409
|
+
return;
|
|
1153
1410
|
}
|
|
1411
|
+
Object.keys(exp).forEach((method) => {
|
|
1412
|
+
if (!supportedMethods.includes(method)) return;
|
|
1413
|
+
const found = this.getCallback(callback, expression, method);
|
|
1414
|
+
if (found) {
|
|
1415
|
+
callbacks.push(found);
|
|
1416
|
+
}
|
|
1417
|
+
});
|
|
1154
1418
|
});
|
|
1155
1419
|
});
|
|
1156
|
-
return
|
|
1420
|
+
return callbacks;
|
|
1157
1421
|
}
|
|
1158
1422
|
/**
|
|
1159
1423
|
* Retrieve an array of callback examples that this operation has.
|
|
1160
1424
|
*
|
|
1425
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
|
|
1426
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
|
|
1161
1427
|
*/
|
|
1162
1428
|
getCallbackExamples() {
|
|
1163
1429
|
if (this.callbackExamples) {
|
|
@@ -1205,6 +1471,121 @@ var Operation = class {
|
|
|
1205
1471
|
this.exampleGroups = groups;
|
|
1206
1472
|
return groups;
|
|
1207
1473
|
}
|
|
1474
|
+
/**
|
|
1475
|
+
* Dereference the current operation schema so it can be parsed free of worries of `$ref` schemas
|
|
1476
|
+
* and circular structures.
|
|
1477
|
+
*
|
|
1478
|
+
*/
|
|
1479
|
+
async dereference(opts) {
|
|
1480
|
+
if (this.dereferencing.complete) {
|
|
1481
|
+
return Promise.resolve(true);
|
|
1482
|
+
}
|
|
1483
|
+
if (this.dereferencing.processing) {
|
|
1484
|
+
return new Promise((resolve, reject) => {
|
|
1485
|
+
this.promises.push({ resolve, reject });
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
this.dereferencing.processing = true;
|
|
1489
|
+
const { children: discriminatorChildrenMap, inverted: discriminatorChildrenMapInverted } = findDiscriminatorChildren(this.api);
|
|
1490
|
+
const { api, schema, promises } = this;
|
|
1491
|
+
if (api?.components?.schemas && typeof api.components.schemas === "object") {
|
|
1492
|
+
Object.keys(api.components.schemas).forEach((schemaName) => {
|
|
1493
|
+
if (isPrimitive(api.components?.schemas?.[schemaName]) || Array.isArray(api.components?.schemas?.[schemaName]) || api.components?.schemas?.[schemaName] === null) {
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
(api.components?.schemas?.[schemaName])["x-readme-ref-name"] = schemaName;
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
const circularRefs = /* @__PURE__ */ new Set();
|
|
1500
|
+
const dereferencingOptions = getDereferencingOptions(circularRefs);
|
|
1501
|
+
const parser = new $RefParser();
|
|
1502
|
+
return parser.dereference(
|
|
1503
|
+
"#/__INTERNAL__",
|
|
1504
|
+
{
|
|
1505
|
+
// Because `json-schema-ref-parser` will dereference this entire object as we only want
|
|
1506
|
+
// to dereference this operation schema we're attaching it to the `__INTERNAL__` key, and
|
|
1507
|
+
// later using that to extract our dereferenced schema. If we didn't do this then we run
|
|
1508
|
+
// the risk of any keyword in `schema` being overriden by `paths` and `components`.
|
|
1509
|
+
//
|
|
1510
|
+
// This solution isn't the best and still requires us to send `json-schema-ref-parser`
|
|
1511
|
+
// basically the entire API defintiion but because we don't know what `$ref` pointers in
|
|
1512
|
+
// `schema` reference, we can't know which parts of full API definition we could safely
|
|
1513
|
+
// exclude from this process.
|
|
1514
|
+
__INTERNAL__: structuredClone(schema),
|
|
1515
|
+
paths: api.paths ?? void 0,
|
|
1516
|
+
components: api.components ?? void 0
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
...dereferencingOptions,
|
|
1520
|
+
dereference: {
|
|
1521
|
+
...dereferencingOptions.dereference,
|
|
1522
|
+
/**
|
|
1523
|
+
* Because we only want to dereference our `__INTERNAL__` schema, not the **entire**
|
|
1524
|
+
* API definition if the parser attemps to dereference anything but that then we
|
|
1525
|
+
* should bail out of that crawler.
|
|
1526
|
+
*
|
|
1527
|
+
* @fixme this may cause issues where a path references a schema within itself to be ignored.
|
|
1528
|
+
*/
|
|
1529
|
+
excludedPathMatcher: (path) => {
|
|
1530
|
+
if (path === "#/paths" || path.startsWith("#/paths/")) {
|
|
1531
|
+
return true;
|
|
1532
|
+
}
|
|
1533
|
+
if (discriminatorChildrenMap.size > 0 || discriminatorChildrenMapInverted.size > 0) {
|
|
1534
|
+
if (path.startsWith("#/components/") && path !== "#/components/schemas" && !path.startsWith("#/components/schemas/")) {
|
|
1535
|
+
return true;
|
|
1536
|
+
}
|
|
1537
|
+
if (path.startsWith("#/components/schemas/")) {
|
|
1538
|
+
const schemaName = path.split("/").pop();
|
|
1539
|
+
if (schemaName && (discriminatorChildrenMap.has(schemaName) || discriminatorChildrenMapInverted.has(schemaName))) {
|
|
1540
|
+
if (path === `#/components/schemas/${schemaName}` || path.startsWith(`#/components/schemas/${schemaName}/`)) {
|
|
1541
|
+
return false;
|
|
1542
|
+
}
|
|
1543
|
+
return true;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
return false;
|
|
1547
|
+
}
|
|
1548
|
+
return path === "#/components" || path.startsWith("#/components/");
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
).then((res) => {
|
|
1553
|
+
const dereferenced = res;
|
|
1554
|
+
if (dereferenced?.components?.schemas && discriminatorChildrenMap.size > 0) {
|
|
1555
|
+
buildDiscriminatorOneOf({ components: dereferenced.components }, discriminatorChildrenMap);
|
|
1556
|
+
}
|
|
1557
|
+
this.schema = dereferenced.__INTERNAL__;
|
|
1558
|
+
this.promises = promises;
|
|
1559
|
+
this.dereferencing = {
|
|
1560
|
+
processing: false,
|
|
1561
|
+
complete: true,
|
|
1562
|
+
// We need to convert our `Set` to an array in order to match the typings.
|
|
1563
|
+
circularRefs: [...circularRefs]
|
|
1564
|
+
};
|
|
1565
|
+
if (opts?.cb) {
|
|
1566
|
+
opts.cb();
|
|
1567
|
+
}
|
|
1568
|
+
}).then(() => {
|
|
1569
|
+
return this.promises.map((deferred) => deferred.resolve());
|
|
1570
|
+
}).catch((err) => {
|
|
1571
|
+
this.dereferencing.processing = false;
|
|
1572
|
+
this.promises.map((deferred) => deferred.reject(err));
|
|
1573
|
+
throw err;
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Retrieve any circular `$ref` pointers that maybe present within operation schema.
|
|
1578
|
+
*
|
|
1579
|
+
* This method requires that you first dereference the definition.
|
|
1580
|
+
*
|
|
1581
|
+
* @see Operation.dereference
|
|
1582
|
+
*/
|
|
1583
|
+
getCircularReferences() {
|
|
1584
|
+
if (!this.dereferencing.complete) {
|
|
1585
|
+
throw new Error(".dereference() must be called first in order for this method to obtain circular references.");
|
|
1586
|
+
}
|
|
1587
|
+
return this.dereferencing.circularRefs;
|
|
1588
|
+
}
|
|
1208
1589
|
};
|
|
1209
1590
|
var Callback = class extends Operation {
|
|
1210
1591
|
/**
|
|
@@ -1258,22 +1639,32 @@ var Webhook = class extends Operation {
|
|
|
1258
1639
|
getSummary() {
|
|
1259
1640
|
if (this.schema?.summary && typeof this.schema.summary === "string") {
|
|
1260
1641
|
return this.schema.summary;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1642
|
+
}
|
|
1643
|
+
const webhookPath = this.api.webhooks?.[this.path];
|
|
1644
|
+
if (webhookPath && !isRef(webhookPath)) {
|
|
1645
|
+
if (webhookPath?.summary && typeof webhookPath.summary === "string") {
|
|
1646
|
+
return webhookPath.summary;
|
|
1647
|
+
}
|
|
1263
1648
|
}
|
|
1264
1649
|
return void 0;
|
|
1265
1650
|
}
|
|
1266
1651
|
getDescription() {
|
|
1267
1652
|
if (this.schema?.description && typeof this.schema.description === "string") {
|
|
1268
1653
|
return this.schema.description;
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1654
|
+
}
|
|
1655
|
+
const webhookPath = this.api.webhooks?.[this.path];
|
|
1656
|
+
if (webhookPath && !isRef(webhookPath)) {
|
|
1657
|
+
if (webhookPath?.description && typeof webhookPath.description === "string") {
|
|
1658
|
+
return webhookPath.description;
|
|
1659
|
+
}
|
|
1271
1660
|
}
|
|
1272
1661
|
return void 0;
|
|
1273
1662
|
}
|
|
1274
1663
|
};
|
|
1275
1664
|
|
|
1276
1665
|
export {
|
|
1666
|
+
findDiscriminatorChildren,
|
|
1667
|
+
buildDiscriminatorOneOf,
|
|
1277
1668
|
Operation,
|
|
1278
1669
|
Callback,
|
|
1279
1670
|
Webhook
|
|
@@ -1290,4 +1681,4 @@ export {
|
|
|
1290
1681
|
* @license Apache-2.0
|
|
1291
1682
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1292
1683
|
*/
|
|
1293
|
-
//# sourceMappingURL=chunk-
|
|
1684
|
+
//# sourceMappingURL=chunk-HGVFNEKW.js.map
|