swagger-client 3.19.5 → 3.19.6
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/dist/swagger-client.browser.js +99 -102
- package/dist/swagger-client.browser.min.js +1 -1
- package/dist/swagger-client.browser.min.js.map +1 -1
- package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +51 -51
- package/lib/execute/oas3/build-request.js +2 -1
- package/lib/index.js +1 -1
- package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +51 -51
- package/lib/subtree-resolver/index.js +22 -1
- package/package.json +5 -5
|
@@ -2893,7 +2893,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
2893
2893
|
methods: {
|
|
2894
2894
|
async ReferenceElement(referenceElement, key, parent, path, ancestors) {
|
|
2895
2895
|
try {
|
|
2896
|
-
const [ancestorsLineage, directAncestors] = this.toAncestorLineage(ancestors);
|
|
2896
|
+
const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
|
|
2897
2897
|
|
|
2898
2898
|
// skip already identified cycled Path Item Objects
|
|
2899
2899
|
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(['cycle'], referenceElement.$ref)) {
|
|
@@ -2942,6 +2942,21 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
2942
2942
|
if (this.indirections.length > this.options.dereference.maxDepth) {
|
|
2943
2943
|
throw new _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_10__["default"](`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);
|
|
2944
2944
|
}
|
|
2945
|
+
if (!this.useCircularStructures) {
|
|
2946
|
+
const hasCycles = ancestorsLineage.some(ancs => ancs.has(fragment));
|
|
2947
|
+
if (hasCycles) {
|
|
2948
|
+
if (_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isHttpUrl(retrievalURI) || _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isFileSystemPath(retrievalURI)) {
|
|
2949
|
+
// make the referencing URL or file system path absolute
|
|
2950
|
+
const cycledReferenceElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.ReferenceElement({
|
|
2951
|
+
$ref: $refBaseURI
|
|
2952
|
+
}, referenceElement.meta.clone(), referenceElement.attributes.clone());
|
|
2953
|
+
cycledReferenceElement.get('$ref').classes.push('cycle');
|
|
2954
|
+
return cycledReferenceElement;
|
|
2955
|
+
}
|
|
2956
|
+
// skip processing this schema and all it's child schemas
|
|
2957
|
+
return false;
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2945
2960
|
|
|
2946
2961
|
// append referencing schema to ancestors lineage
|
|
2947
2962
|
directAncestors.add(referenceElement);
|
|
@@ -2965,21 +2980,6 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
2965
2980
|
// remove referencing schema from ancestors lineage
|
|
2966
2981
|
directAncestors.delete(referenceElement);
|
|
2967
2982
|
this.indirections.pop();
|
|
2968
|
-
if (!this.useCircularStructures) {
|
|
2969
|
-
const hasCycles = ancestorsLineage.some(ancs => ancs.has(fragment));
|
|
2970
|
-
if (hasCycles) {
|
|
2971
|
-
if (_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isHttpUrl(retrievalURI) || _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isFileSystemPath(retrievalURI)) {
|
|
2972
|
-
// make the referencing URL or file system path absolute
|
|
2973
|
-
const cycledReferenceElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.ReferenceElement({
|
|
2974
|
-
$ref: $refBaseURI
|
|
2975
|
-
}, referenceElement.meta.clone(), referenceElement.attributes.clone());
|
|
2976
|
-
cycledReferenceElement.get('$ref').classes.push('cycle');
|
|
2977
|
-
return cycledReferenceElement;
|
|
2978
|
-
}
|
|
2979
|
-
// skip processing this schema but traverse all it's child schemas
|
|
2980
|
-
return false;
|
|
2981
|
-
}
|
|
2982
|
-
}
|
|
2983
2983
|
fragment = fragment.clone();
|
|
2984
2984
|
fragment.setMetaProperty('ref-fields', {
|
|
2985
2985
|
$ref: referenceElement.$ref?.toValue(),
|
|
@@ -3025,7 +3025,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
3025
3025
|
},
|
|
3026
3026
|
async PathItemElement(pathItemElement, key, parent, path, ancestors) {
|
|
3027
3027
|
try {
|
|
3028
|
-
const [ancestorsLineage, directAncestors] = this.toAncestorLineage(ancestors);
|
|
3028
|
+
const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
|
|
3029
3029
|
|
|
3030
3030
|
// ignore PathItemElement without $ref field
|
|
3031
3031
|
if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(pathItemElement.$ref)) {
|
|
@@ -3070,6 +3070,21 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
3070
3070
|
if (this.indirections.length > this.options.dereference.maxDepth) {
|
|
3071
3071
|
throw new _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_10__["default"](`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);
|
|
3072
3072
|
}
|
|
3073
|
+
if (!this.useCircularStructures) {
|
|
3074
|
+
const hasCycles = ancestorsLineage.some(ancs => ancs.has(referencedElement));
|
|
3075
|
+
if (hasCycles) {
|
|
3076
|
+
if (_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isHttpUrl(retrievalURI) || _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isFileSystemPath(retrievalURI)) {
|
|
3077
|
+
// make the referencing URL or file system path absolute
|
|
3078
|
+
const cycledPathItemElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.PathItemElement({
|
|
3079
|
+
$ref: $refBaseURI
|
|
3080
|
+
}, pathItemElement.meta.clone(), pathItemElement.attributes.clone());
|
|
3081
|
+
cycledPathItemElement.get('$ref').classes.push('cycle');
|
|
3082
|
+
return cycledPathItemElement;
|
|
3083
|
+
}
|
|
3084
|
+
// skip processing this schema and all it's child schemas
|
|
3085
|
+
return false;
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3073
3088
|
|
|
3074
3089
|
// append referencing schema to ancestors lineage
|
|
3075
3090
|
directAncestors.add(pathItemElement);
|
|
@@ -3093,21 +3108,6 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
3093
3108
|
// remove referencing schema from ancestors lineage
|
|
3094
3109
|
directAncestors.delete(pathItemElement);
|
|
3095
3110
|
this.indirections.pop();
|
|
3096
|
-
if (!this.useCircularStructures) {
|
|
3097
|
-
const hasCycles = ancestorsLineage.some(ancs => ancs.has(referencedElement));
|
|
3098
|
-
if (hasCycles) {
|
|
3099
|
-
if (_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isHttpUrl(retrievalURI) || _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isFileSystemPath(retrievalURI)) {
|
|
3100
|
-
// make the referencing URL or file system path absolute
|
|
3101
|
-
const cycledPathItemElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.PathItemElement({
|
|
3102
|
-
$ref: $refBaseURI
|
|
3103
|
-
}, pathItemElement.meta.clone(), pathItemElement.attributes.clone());
|
|
3104
|
-
cycledPathItemElement.get('$ref').classes.push('cycle');
|
|
3105
|
-
return cycledPathItemElement;
|
|
3106
|
-
}
|
|
3107
|
-
// skip processing this schema but traverse all it's child schemas
|
|
3108
|
-
return false;
|
|
3109
|
-
}
|
|
3110
|
-
}
|
|
3111
3111
|
|
|
3112
3112
|
// merge fields from referenced Path Item with referencing one
|
|
3113
3113
|
const mergedPathItemElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.PathItemElement([...referencedElement.content], referencedElement.meta.clone(), referencedElement.attributes.clone());
|
|
@@ -3150,7 +3150,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
3150
3150
|
},
|
|
3151
3151
|
async SchemaElement(referencingElement, key, parent, path, ancestors) {
|
|
3152
3152
|
try {
|
|
3153
|
-
const [ancestorsLineage, directAncestors] = this.toAncestorLineage(ancestors);
|
|
3153
|
+
const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
|
|
3154
3154
|
|
|
3155
3155
|
// skip current referencing schema as $ref keyword was not defined
|
|
3156
3156
|
if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__.isStringElement)(referencingElement.$ref)) {
|
|
@@ -3240,6 +3240,24 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
3240
3240
|
throw new _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_10__["default"](`Maximum dereference depth of "${this.options.dereference.maxDepth}" has been exceeded in file "${this.reference.uri}"`);
|
|
3241
3241
|
}
|
|
3242
3242
|
|
|
3243
|
+
// useCircularStructures option processing
|
|
3244
|
+
if (!this.useCircularStructures) {
|
|
3245
|
+
const hasCycles = ancestorsLineage.some(ancs => ancs.has(referencedElement));
|
|
3246
|
+
if (hasCycles) {
|
|
3247
|
+
if (_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isHttpUrl(retrievalURI) || _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isFileSystemPath(retrievalURI)) {
|
|
3248
|
+
// make the referencing URL or file system path absolute
|
|
3249
|
+
const baseURI = _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.resolve(retrievalURI, $refBaseURI);
|
|
3250
|
+
const cycledSchemaElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.SchemaElement({
|
|
3251
|
+
$ref: baseURI
|
|
3252
|
+
}, referencingElement.meta.clone(), referencingElement.attributes.clone());
|
|
3253
|
+
cycledSchemaElement.get('$ref').classes.push('cycle');
|
|
3254
|
+
return cycledSchemaElement;
|
|
3255
|
+
}
|
|
3256
|
+
// skip processing this schema and all it's child schemas
|
|
3257
|
+
return false;
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
|
|
3243
3261
|
// append referencing schema to ancestors lineage
|
|
3244
3262
|
directAncestors.add(referencingElement);
|
|
3245
3263
|
|
|
@@ -3274,24 +3292,6 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _swagger_api_apidom_reference_
|
|
|
3274
3292
|
return jsonSchemaBooleanElement;
|
|
3275
3293
|
}
|
|
3276
3294
|
|
|
3277
|
-
// useCircularStructures option processing
|
|
3278
|
-
if (!this.useCircularStructures) {
|
|
3279
|
-
const hasCycles = ancestorsLineage.some(ancs => ancs.has(referencedElement));
|
|
3280
|
-
if (hasCycles) {
|
|
3281
|
-
if (_swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isHttpUrl(retrievalURI) || _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.isFileSystemPath(retrievalURI)) {
|
|
3282
|
-
// make the referencing URL or file system path absolute
|
|
3283
|
-
const baseURI = _swagger_api_apidom_reference_configuration_empty__WEBPACK_IMPORTED_MODULE_6__.resolve(retrievalURI, $refBaseURI);
|
|
3284
|
-
const cycledSchemaElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.SchemaElement({
|
|
3285
|
-
$ref: baseURI
|
|
3286
|
-
}, referencingElement.meta.clone(), referencingElement.attributes.clone());
|
|
3287
|
-
cycledSchemaElement.get('$ref').classes.push('cycle');
|
|
3288
|
-
return cycledSchemaElement;
|
|
3289
|
-
}
|
|
3290
|
-
// skip processing this schema but traverse all it's child schemas
|
|
3291
|
-
return false;
|
|
3292
|
-
}
|
|
3293
|
-
}
|
|
3294
|
-
|
|
3295
3295
|
// Schema Object - merge keywords from referenced schema with referencing schema
|
|
3296
3296
|
const mergedSchemaElement = new _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.SchemaElement([...referencedElement.content], referencedElement.meta.clone(), referencedElement.attributes.clone());
|
|
3297
3297
|
// existing keywords from referencing schema overrides ones from referenced schema
|
|
@@ -22702,13 +22702,11 @@ const YamlVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
|
|
|
22702
22702
|
indentChar: ' '
|
|
22703
22703
|
},
|
|
22704
22704
|
init({
|
|
22705
|
-
|
|
22706
|
-
indent = 0
|
|
22707
|
-
indentChar = ' '
|
|
22705
|
+
directive = false,
|
|
22706
|
+
indent = 0
|
|
22708
22707
|
} = {}) {
|
|
22709
|
-
this.result =
|
|
22708
|
+
this.result = directive ? '%YAML 1.2\n---\n' : '';
|
|
22710
22709
|
this.indent = indent;
|
|
22711
|
-
this.indentChard = indentChar;
|
|
22712
22710
|
},
|
|
22713
22711
|
methods: {
|
|
22714
22712
|
NumberElement(element) {
|
|
@@ -22739,7 +22737,7 @@ const YamlVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
|
|
|
22739
22737
|
const {
|
|
22740
22738
|
result
|
|
22741
22739
|
} = visitor;
|
|
22742
|
-
this.result += result.startsWith('\n') ? `\n${indent}-${
|
|
22740
|
+
this.result += result.startsWith('\n') ? `\n${indent}-${result}` : `\n${indent}- ${result}`;
|
|
22743
22741
|
});
|
|
22744
22742
|
return false;
|
|
22745
22743
|
},
|
|
@@ -22770,10 +22768,11 @@ const YamlVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
|
|
|
22770
22768
|
}
|
|
22771
22769
|
}
|
|
22772
22770
|
});
|
|
22773
|
-
const serializer = element
|
|
22774
|
-
|
|
22771
|
+
const serializer = (element, {
|
|
22772
|
+
directive = false
|
|
22773
|
+
} = {}) => {
|
|
22775
22774
|
const visitor = YamlVisitor({
|
|
22776
|
-
|
|
22775
|
+
directive
|
|
22777
22776
|
});
|
|
22778
22777
|
(0,_traversal_visitor_js__WEBPACK_IMPORTED_MODULE_2__.visit)(element, visitor);
|
|
22779
22778
|
return visitor.result;
|
|
@@ -36509,7 +36508,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
36509
36508
|
* When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object,
|
|
36510
36509
|
* only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request.
|
|
36511
36510
|
*/
|
|
36512
|
-
|
|
36513
36511
|
/* eslint-disable no-param-reassign */
|
|
36514
36512
|
const plugin = () => ({
|
|
36515
36513
|
predicates
|
|
@@ -36575,7 +36573,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
36575
36573
|
* If an alternative server object is specified at the Path Item Object level, it will override OpenAPI.servers.
|
|
36576
36574
|
* If an alternative server object is specified at the Operation Object level, it will override PathItem.servers and OpenAPI.servers respectively.
|
|
36577
36575
|
*/
|
|
36578
|
-
|
|
36579
36576
|
/* eslint-disable no-param-reassign */
|
|
36580
36577
|
const plugin = () => ({
|
|
36581
36578
|
predicates
|
|
@@ -40414,20 +40411,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
40414
40411
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5413);
|
|
40415
40412
|
/* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(4926);
|
|
40416
40413
|
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66175);
|
|
40417
|
-
/* harmony import */ var
|
|
40414
|
+
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67277);
|
|
40418
40415
|
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(69346);
|
|
40419
|
-
/* harmony import */ var
|
|
40420
|
-
/* harmony import */ var
|
|
40416
|
+
/* harmony import */ var _swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(77782);
|
|
40417
|
+
/* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(94022);
|
|
40421
40418
|
/* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(21066);
|
|
40422
40419
|
/* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(64614);
|
|
40423
40420
|
/* harmony import */ var _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(37988);
|
|
40424
40421
|
/* harmony import */ var _selectors_$anchor_index_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(24634);
|
|
40425
40422
|
/* harmony import */ var _selectors_uri_index_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(96930);
|
|
40426
|
-
/* harmony import */ var
|
|
40423
|
+
/* harmony import */ var _util_errors_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(22513);
|
|
40427
40424
|
/* harmony import */ var _util_errors_index_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(86144);
|
|
40428
40425
|
/* harmony import */ var _util_url_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8549);
|
|
40429
|
-
/* harmony import */ var
|
|
40430
|
-
/* harmony import */ var
|
|
40426
|
+
/* harmony import */ var _parse_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(79605);
|
|
40427
|
+
/* harmony import */ var _Reference_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(39816);
|
|
40431
40428
|
/* harmony import */ var _util_File_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(49512);
|
|
40432
40429
|
/* harmony import */ var _resolve_strategies_openapi_3_1_util_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(49021);
|
|
40433
40430
|
/* harmony import */ var _selectors_uri_errors_EvaluationJsonSchemaUriError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(51454);
|
|
@@ -40482,14 +40479,14 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40482
40479
|
* Compute full ancestors lineage.
|
|
40483
40480
|
* Ancestors are flatten to unwrap all Element instances.
|
|
40484
40481
|
*/
|
|
40485
|
-
const directAncestors = new WeakSet(ancestors.
|
|
40482
|
+
const directAncestors = new WeakSet(ancestors.filter(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isElement));
|
|
40486
40483
|
const ancestorsLineage = [...this.ancestors, directAncestors];
|
|
40487
40484
|
return [ancestorsLineage, directAncestors];
|
|
40488
40485
|
},
|
|
40489
40486
|
async toReference(uri) {
|
|
40490
40487
|
// detect maximum depth of resolution
|
|
40491
40488
|
if (this.reference.depth >= this.options.resolve.maxDepth) {
|
|
40492
|
-
throw new
|
|
40489
|
+
throw new _util_errors_index_js__WEBPACK_IMPORTED_MODULE_6__["default"](`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`);
|
|
40493
40490
|
}
|
|
40494
40491
|
const baseURI = this.toBaseURI(uri);
|
|
40495
40492
|
const {
|
|
@@ -40500,14 +40497,14 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40500
40497
|
if (refSet.has(baseURI)) {
|
|
40501
40498
|
return refSet.find((0,ramda__WEBPACK_IMPORTED_MODULE_2__.propEq)('uri', baseURI));
|
|
40502
40499
|
}
|
|
40503
|
-
const parseResult = await (0,
|
|
40500
|
+
const parseResult = await (0,_parse_index_js__WEBPACK_IMPORTED_MODULE_7__["default"])(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize(baseURI), _objectSpread(_objectSpread({}, this.options), {}, {
|
|
40504
40501
|
parse: _objectSpread(_objectSpread({}, this.options.parse), {}, {
|
|
40505
40502
|
mediaType: 'text/plain'
|
|
40506
40503
|
})
|
|
40507
40504
|
}));
|
|
40508
40505
|
|
|
40509
40506
|
// register new Reference with ReferenceSet
|
|
40510
|
-
const reference = (0,
|
|
40507
|
+
const reference = (0,_Reference_js__WEBPACK_IMPORTED_MODULE_8__["default"])({
|
|
40511
40508
|
uri: baseURI,
|
|
40512
40509
|
value: parseResult,
|
|
40513
40510
|
depth: this.reference.depth + 1
|
|
@@ -40517,7 +40514,7 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40517
40514
|
},
|
|
40518
40515
|
async ReferenceElement(referencingElement, key, parent, path, ancestors) {
|
|
40519
40516
|
var _referencingElement$$, _referencingElement$$2, _referencingElement$$3, _referencingElement$d, _referencingElement$s;
|
|
40520
|
-
const [ancestorsLineage, directAncestors] = this.toAncestorLineage(ancestors);
|
|
40517
|
+
const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
|
|
40521
40518
|
|
|
40522
40519
|
// detect possible cycle in traversal and avoid it
|
|
40523
40520
|
if (ancestorsLineage.some(ancs => ancs.has(referencingElement))) {
|
|
@@ -40526,20 +40523,20 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40526
40523
|
}
|
|
40527
40524
|
|
|
40528
40525
|
// ignore resolving external Reference Objects
|
|
40529
|
-
if (!this.options.resolve.external && (0,
|
|
40526
|
+
if (!this.options.resolve.external && (0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.isReferenceElementExternal)(referencingElement)) {
|
|
40530
40527
|
return false;
|
|
40531
40528
|
}
|
|
40532
40529
|
const reference = await this.toReference((_referencingElement$$ = referencingElement.$ref) === null || _referencingElement$$ === void 0 ? void 0 : _referencingElement$$.toValue());
|
|
40533
40530
|
const retrievalURI = reference.uri;
|
|
40534
40531
|
const $refBaseURI = _util_url_js__WEBPACK_IMPORTED_MODULE_4__.resolve(retrievalURI, (_referencingElement$$2 = referencingElement.$ref) === null || _referencingElement$$2 === void 0 ? void 0 : _referencingElement$$2.toValue());
|
|
40535
40532
|
this.indirections.push(referencingElement);
|
|
40536
|
-
const jsonPointer = (0,
|
|
40533
|
+
const jsonPointer = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.uriToPointer)($refBaseURI);
|
|
40537
40534
|
|
|
40538
40535
|
// possibly non-semantic fragment
|
|
40539
|
-
let referencedElement = (0,
|
|
40536
|
+
let referencedElement = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(jsonPointer, reference.value.result);
|
|
40540
40537
|
|
|
40541
40538
|
// applying semantics to a fragment
|
|
40542
|
-
if ((0,
|
|
40539
|
+
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isPrimitiveElement)(referencedElement)) {
|
|
40543
40540
|
const referencedElementType = referencingElement.meta.get('referenced-element').toValue();
|
|
40544
40541
|
if ((0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_11__.isReferenceLikeElement)(referencedElement)) {
|
|
40545
40542
|
// handling indirect references
|
|
@@ -40612,10 +40609,10 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40612
40609
|
},
|
|
40613
40610
|
async PathItemElement(referencingElement, key, parent, path, ancestors) {
|
|
40614
40611
|
var _referencingElement$$4, _referencingElement$$5, _referencingElement$$6;
|
|
40615
|
-
const [ancestorsLineage, directAncestors] = this.toAncestorLineage(ancestors);
|
|
40612
|
+
const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
|
|
40616
40613
|
|
|
40617
40614
|
// ignore PathItemElement without $ref field
|
|
40618
|
-
if (!(0,
|
|
40615
|
+
if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(referencingElement.$ref)) {
|
|
40619
40616
|
return undefined;
|
|
40620
40617
|
}
|
|
40621
40618
|
|
|
@@ -40626,20 +40623,20 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40626
40623
|
}
|
|
40627
40624
|
|
|
40628
40625
|
// ignore resolving external Path Item Elements
|
|
40629
|
-
if (!this.options.resolve.external && (0,
|
|
40626
|
+
if (!this.options.resolve.external && (0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.isPathItemElementExternal)(referencingElement)) {
|
|
40630
40627
|
return undefined;
|
|
40631
40628
|
}
|
|
40632
40629
|
const reference = await this.toReference((_referencingElement$$4 = referencingElement.$ref) === null || _referencingElement$$4 === void 0 ? void 0 : _referencingElement$$4.toValue());
|
|
40633
40630
|
const retrievalURI = reference.uri;
|
|
40634
40631
|
const $refBaseURI = _util_url_js__WEBPACK_IMPORTED_MODULE_4__.resolve(retrievalURI, (_referencingElement$$5 = referencingElement.$ref) === null || _referencingElement$$5 === void 0 ? void 0 : _referencingElement$$5.toValue());
|
|
40635
40632
|
this.indirections.push(referencingElement);
|
|
40636
|
-
const jsonPointer = (0,
|
|
40633
|
+
const jsonPointer = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.uriToPointer)($refBaseURI);
|
|
40637
40634
|
|
|
40638
40635
|
// possibly non-semantic referenced element
|
|
40639
|
-
let referencedElement = (0,
|
|
40636
|
+
let referencedElement = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(jsonPointer, reference.value.result);
|
|
40640
40637
|
|
|
40641
40638
|
// applying semantics to a referenced element
|
|
40642
|
-
if ((0,
|
|
40639
|
+
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isPrimitiveElement)(referencedElement)) {
|
|
40643
40640
|
referencedElement = _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_12__.PathItemElement.refract(referencedElement);
|
|
40644
40641
|
}
|
|
40645
40642
|
|
|
@@ -40696,30 +40693,30 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40696
40693
|
},
|
|
40697
40694
|
async LinkElement(linkElement) {
|
|
40698
40695
|
// ignore LinkElement without operationRef or operationId field
|
|
40699
|
-
if (!(0,
|
|
40696
|
+
if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(linkElement.operationRef) && !(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(linkElement.operationId)) {
|
|
40700
40697
|
return undefined;
|
|
40701
40698
|
}
|
|
40702
40699
|
|
|
40703
40700
|
// ignore resolving external Path Item Elements
|
|
40704
|
-
if (!this.options.resolve.external && (0,
|
|
40701
|
+
if (!this.options.resolve.external && (0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.isLinkElementExternal)(linkElement)) {
|
|
40705
40702
|
return undefined;
|
|
40706
40703
|
}
|
|
40707
40704
|
|
|
40708
40705
|
// operationRef and operationId fields are mutually exclusive
|
|
40709
|
-
if ((0,
|
|
40706
|
+
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(linkElement.operationRef) && (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(linkElement.operationId)) {
|
|
40710
40707
|
throw new Error('LinkElement operationRef and operationId fields are mutually exclusive.');
|
|
40711
40708
|
}
|
|
40712
40709
|
|
|
40713
40710
|
// @ts-ignore
|
|
40714
40711
|
let operationElement;
|
|
40715
|
-
if ((0,
|
|
40712
|
+
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(linkElement.operationRef)) {
|
|
40716
40713
|
var _linkElement$operatio, _linkElement$operatio2, _linkElement$operatio3;
|
|
40717
40714
|
// possibly non-semantic referenced element
|
|
40718
|
-
const jsonPointer = (0,
|
|
40715
|
+
const jsonPointer = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.uriToPointer)((_linkElement$operatio = linkElement.operationRef) === null || _linkElement$operatio === void 0 ? void 0 : _linkElement$operatio.toValue());
|
|
40719
40716
|
const reference = await this.toReference((_linkElement$operatio2 = linkElement.operationRef) === null || _linkElement$operatio2 === void 0 ? void 0 : _linkElement$operatio2.toValue());
|
|
40720
|
-
operationElement = (0,
|
|
40717
|
+
operationElement = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(jsonPointer, reference.value.result);
|
|
40721
40718
|
// applying semantics to a referenced element
|
|
40722
|
-
if ((0,
|
|
40719
|
+
if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isPrimitiveElement)(operationElement)) {
|
|
40723
40720
|
operationElement = _swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_12__.OperationElement.refract(operationElement);
|
|
40724
40721
|
}
|
|
40725
40722
|
// create shallow clone to be able to annotate with metadata
|
|
@@ -40729,10 +40726,10 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40729
40726
|
// annotate operation element with info about origin
|
|
40730
40727
|
operationElement.setMetaProperty('ref-origin', reference.uri);
|
|
40731
40728
|
(_linkElement$operatio3 = linkElement.operationRef) === null || _linkElement$operatio3 === void 0 ? void 0 : _linkElement$operatio3.meta.set('operation', operationElement);
|
|
40732
|
-
} else if ((0,
|
|
40729
|
+
} else if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(linkElement.operationId)) {
|
|
40733
40730
|
var _linkElement$operatio4, _linkElement$operatio5;
|
|
40734
40731
|
const operationId = (_linkElement$operatio4 = linkElement.operationId) === null || _linkElement$operatio4 === void 0 ? void 0 : _linkElement$operatio4.toValue();
|
|
40735
|
-
operationElement = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_16__["default"])(e => (0,
|
|
40732
|
+
operationElement = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_16__["default"])(e => (0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.isOperationElement)(e) && e.operationId.equals(operationId), this.reference.value.result);
|
|
40736
40733
|
// OperationElement not found by its operationId
|
|
40737
40734
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_17__["default"])(operationElement)) {
|
|
40738
40735
|
throw new Error(`OperationElement(operationId=${operationId}) not found.`);
|
|
@@ -40744,17 +40741,17 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40744
40741
|
async ExampleElement(exampleElement) {
|
|
40745
40742
|
var _exampleElement$exter;
|
|
40746
40743
|
// ignore ExampleElement without externalValue field
|
|
40747
|
-
if (!(0,
|
|
40744
|
+
if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(exampleElement.externalValue)) {
|
|
40748
40745
|
return undefined;
|
|
40749
40746
|
}
|
|
40750
40747
|
|
|
40751
40748
|
// ignore resolving ExampleElement externalValue
|
|
40752
|
-
if (!this.options.resolve.external && (0,
|
|
40749
|
+
if (!this.options.resolve.external && (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(exampleElement.externalValue)) {
|
|
40753
40750
|
return undefined;
|
|
40754
40751
|
}
|
|
40755
40752
|
|
|
40756
40753
|
// value and externalValue fields are mutually exclusive
|
|
40757
|
-
if (exampleElement.hasKey('value') && (0,
|
|
40754
|
+
if (exampleElement.hasKey('value') && (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(exampleElement.externalValue)) {
|
|
40758
40755
|
throw new Error('ExampleElement value and externalValue fields are mutually exclusive.');
|
|
40759
40756
|
}
|
|
40760
40757
|
const reference = await this.toReference((_exampleElement$exter = exampleElement.externalValue) === null || _exampleElement$exter === void 0 ? void 0 : _exampleElement$exter.toValue());
|
|
@@ -40770,10 +40767,10 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40770
40767
|
},
|
|
40771
40768
|
async SchemaElement(referencingElement, key, parent, path, ancestors) {
|
|
40772
40769
|
var _referencingElement$$8;
|
|
40773
|
-
const [ancestorsLineage, directAncestors] = this.toAncestorLineage(ancestors);
|
|
40770
|
+
const [ancestorsLineage, directAncestors] = this.toAncestorLineage([...ancestors, parent]);
|
|
40774
40771
|
|
|
40775
40772
|
// skip current referencing schema as $ref keyword was not defined
|
|
40776
|
-
if (!(0,
|
|
40773
|
+
if (!(0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_5__.isStringElement)(referencingElement.$ref)) {
|
|
40777
40774
|
// skip traversing this schema but traverse all it's child schemas
|
|
40778
40775
|
return undefined;
|
|
40779
40776
|
}
|
|
@@ -40819,10 +40816,10 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40819
40816
|
} else {
|
|
40820
40817
|
// we're assuming here that we're dealing with JSON Pointer here
|
|
40821
40818
|
reference = await this.toReference(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize($refBaseURI));
|
|
40822
|
-
const selector = (0,
|
|
40819
|
+
const selector = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.uriToPointer)($refBaseURI);
|
|
40823
40820
|
referencedElement = (0,_resolve_strategies_openapi_3_1_util_js__WEBPACK_IMPORTED_MODULE_18__.maybeRefractToSchemaElement)(
|
|
40824
40821
|
// @ts-ignore
|
|
40825
|
-
(0,
|
|
40822
|
+
(0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(selector, reference.value.result));
|
|
40826
40823
|
}
|
|
40827
40824
|
} catch (error) {
|
|
40828
40825
|
/**
|
|
@@ -40842,10 +40839,10 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40842
40839
|
// we're assuming here that we're dealing with JSON Pointer here
|
|
40843
40840
|
reference = await this.toReference(_util_url_js__WEBPACK_IMPORTED_MODULE_4__.unsanitize($refBaseURI));
|
|
40844
40841
|
retrievalURI = reference.uri;
|
|
40845
|
-
const selector = (0,
|
|
40842
|
+
const selector = (0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.uriToPointer)($refBaseURI);
|
|
40846
40843
|
referencedElement = (0,_resolve_strategies_openapi_3_1_util_js__WEBPACK_IMPORTED_MODULE_18__.maybeRefractToSchemaElement)(
|
|
40847
40844
|
// @ts-ignore
|
|
40848
|
-
(0,
|
|
40845
|
+
(0,_swagger_api_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(selector, reference.value.result));
|
|
40849
40846
|
}
|
|
40850
40847
|
} else {
|
|
40851
40848
|
throw error;
|
|
@@ -40883,7 +40880,7 @@ const OpenApi3_1DereferenceVisitor = stampit__WEBPACK_IMPORTED_MODULE_1__({
|
|
|
40883
40880
|
this.indirections.pop();
|
|
40884
40881
|
|
|
40885
40882
|
// Boolean JSON Schemas
|
|
40886
|
-
if ((0,
|
|
40883
|
+
if ((0,_swagger_api_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_9__.isBooleanJsonSchemaElement)(referencedElement)) {
|
|
40887
40884
|
var _referencingElement$$7;
|
|
40888
40885
|
const referencedElementClone = referencedElement.clone();
|
|
40889
40886
|
// annotate referenced element with info about original referencing element
|