@speclynx/apidom-overlay 4.13.0 → 4.15.0

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.
@@ -40864,6 +40864,149 @@ const refractWorkflow = (value, options = {}) => refract(value, {
40864
40864
  });
40865
40865
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (refract);
40866
40866
 
40867
+ /***/ },
40868
+
40869
+ /***/ 90016
40870
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
40871
+
40872
+ "use strict";
40873
+ __webpack_require__.r(__webpack_exports__);
40874
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
40875
+ /* harmony export */ ArazzoElement: () => (/* reexport safe */ _elements_Arazzo_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
40876
+ /* harmony export */ ArazzoSpecification1Element: () => (/* reexport safe */ _elements_ArazzoSpecification1_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]),
40877
+ /* harmony export */ ComponentsElement: () => (/* reexport safe */ _elements_Components_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]),
40878
+ /* harmony export */ CriterionElement: () => (/* reexport safe */ _elements_Criterion_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]),
40879
+ /* harmony export */ CriterionExpressionTypeElement: () => (/* reexport safe */ _elements_CriterionExpressionType_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
40880
+ /* harmony export */ FailureActionElement: () => (/* reexport safe */ _elements_FailureAction_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
40881
+ /* harmony export */ InfoElement: () => (/* reexport safe */ _elements_Info_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
40882
+ /* harmony export */ JSONSchemaElement: () => (/* reexport safe */ _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
40883
+ /* harmony export */ ParameterElement: () => (/* reexport safe */ _elements_Parameter_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]),
40884
+ /* harmony export */ PayloadReplacementElement: () => (/* reexport safe */ _elements_PayloadReplacement_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]),
40885
+ /* harmony export */ RequestBodyElement: () => (/* reexport safe */ _elements_RequestBody_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]),
40886
+ /* harmony export */ ReusableElement: () => (/* reexport safe */ _elements_Reusable_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]),
40887
+ /* harmony export */ SourceDescriptionElement: () => (/* reexport safe */ _elements_SourceDescription_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]),
40888
+ /* harmony export */ StepElement: () => (/* reexport safe */ _elements_Step_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]),
40889
+ /* harmony export */ SuccessActionElement: () => (/* reexport safe */ _elements_SuccessAction_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]),
40890
+ /* harmony export */ WorkflowElement: () => (/* reexport safe */ _elements_Workflow_mjs__WEBPACK_IMPORTED_MODULE_17__["default"])
40891
+ /* harmony export */ });
40892
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60572);
40893
+ /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34606);
40894
+ /* harmony import */ var _elements_Arazzo_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12400);
40895
+ /* harmony import */ var _elements_ArazzoSpecification1_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53540);
40896
+ /* harmony import */ var _elements_Components_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(36245);
40897
+ /* harmony import */ var _elements_Criterion_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59302);
40898
+ /* harmony import */ var _elements_CriterionExpressionType_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(90696);
40899
+ /* harmony import */ var _elements_FailureAction_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(32623);
40900
+ /* harmony import */ var _elements_Info_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(59801);
40901
+ /* harmony import */ var _elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(99922);
40902
+ /* harmony import */ var _elements_Parameter_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(66726);
40903
+ /* harmony import */ var _elements_PayloadReplacement_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2923);
40904
+ /* harmony import */ var _elements_RequestBody_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(44452);
40905
+ /* harmony import */ var _elements_Reusable_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(8954);
40906
+ /* harmony import */ var _elements_SourceDescription_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(43368);
40907
+ /* harmony import */ var _elements_Step_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(67923);
40908
+ /* harmony import */ var _elements_SuccessAction_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(256);
40909
+ /* harmony import */ var _elements_Workflow_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(46750);
40910
+ /* harmony import */ var _specification_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(62707);
40911
+
40912
+
40913
+
40914
+
40915
+
40916
+
40917
+
40918
+
40919
+
40920
+
40921
+
40922
+
40923
+
40924
+
40925
+
40926
+
40927
+
40928
+
40929
+
40930
+ /**
40931
+ * @public
40932
+ */
40933
+ const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__.resolveSpecification)(_specification_mjs__WEBPACK_IMPORTED_MODULE_18__["default"]);
40934
+ const getFixedFields = fixedFieldsSpec => {
40935
+ return Object.entries(fixedFieldsSpec).map(([name, fieldSpec]) => {
40936
+ if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(fieldSpec)) {
40937
+ return {
40938
+ name,
40939
+ ...fieldSpec
40940
+ };
40941
+ }
40942
+ return {
40943
+ name,
40944
+ $visitor: fieldSpec
40945
+ };
40946
+ });
40947
+ };
40948
+ Object.defineProperty(_elements_ArazzoSpecification1_mjs__WEBPACK_IMPORTED_MODULE_3__["default"], 'fixedFields', {
40949
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.ArazzoSpecification.fixedFields),
40950
+ enumerable: true
40951
+ });
40952
+ Object.defineProperty(_elements_Components_mjs__WEBPACK_IMPORTED_MODULE_4__["default"], 'fixedFields', {
40953
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Components.fixedFields),
40954
+ enumerable: true
40955
+ });
40956
+ Object.defineProperty(_elements_Criterion_mjs__WEBPACK_IMPORTED_MODULE_5__["default"], 'fixedFields', {
40957
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Criterion.fixedFields),
40958
+ enumerable: true
40959
+ });
40960
+ Object.defineProperty(_elements_CriterionExpressionType_mjs__WEBPACK_IMPORTED_MODULE_6__["default"], 'fixedFields', {
40961
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.CriterionExpressionType.fixedFields),
40962
+ enumerable: true
40963
+ });
40964
+ Object.defineProperty(_elements_FailureAction_mjs__WEBPACK_IMPORTED_MODULE_7__["default"], 'fixedFields', {
40965
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.FailureAction.fixedFields),
40966
+ enumerable: true
40967
+ });
40968
+ Object.defineProperty(_elements_Info_mjs__WEBPACK_IMPORTED_MODULE_8__["default"], 'fixedFields', {
40969
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Info.fixedFields),
40970
+ enumerable: true
40971
+ });
40972
+ Object.defineProperty(_elements_JSONSchema_mjs__WEBPACK_IMPORTED_MODULE_9__["default"], 'fixedFields', {
40973
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.JSONSchema.fixedFields),
40974
+ enumerable: true
40975
+ });
40976
+ Object.defineProperty(_elements_Parameter_mjs__WEBPACK_IMPORTED_MODULE_10__["default"], 'fixedFields', {
40977
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Parameter.fixedFields),
40978
+ enumerable: true
40979
+ });
40980
+ Object.defineProperty(_elements_PayloadReplacement_mjs__WEBPACK_IMPORTED_MODULE_11__["default"], 'fixedFields', {
40981
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.PayloadReplacement.fixedFields),
40982
+ enumerable: true
40983
+ });
40984
+ Object.defineProperty(_elements_RequestBody_mjs__WEBPACK_IMPORTED_MODULE_12__["default"], 'fixedFields', {
40985
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.RequestBody.fixedFields),
40986
+ enumerable: true
40987
+ });
40988
+ Object.defineProperty(_elements_Reusable_mjs__WEBPACK_IMPORTED_MODULE_13__["default"], 'fixedFields', {
40989
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Reusable.fixedFields),
40990
+ enumerable: true
40991
+ });
40992
+ Object.defineProperty(_elements_SourceDescription_mjs__WEBPACK_IMPORTED_MODULE_14__["default"], 'fixedFields', {
40993
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.SourceDescription.fixedFields),
40994
+ enumerable: true
40995
+ });
40996
+ Object.defineProperty(_elements_Step_mjs__WEBPACK_IMPORTED_MODULE_15__["default"], 'fixedFields', {
40997
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Step.fixedFields),
40998
+ enumerable: true
40999
+ });
41000
+ Object.defineProperty(_elements_SuccessAction_mjs__WEBPACK_IMPORTED_MODULE_16__["default"], 'fixedFields', {
41001
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.SuccessAction.fixedFields),
41002
+ enumerable: true
41003
+ });
41004
+ Object.defineProperty(_elements_Workflow_mjs__WEBPACK_IMPORTED_MODULE_17__["default"], 'fixedFields', {
41005
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Workflow.fixedFields),
41006
+ enumerable: true
41007
+ });
41008
+
41009
+
40867
41010
  /***/ },
40868
41011
 
40869
41012
  /***/ 59726
@@ -77700,6 +77843,254 @@ const refractJsonSchemaDialect = (value, options = {}) => refract(value, {
77700
77843
  });
77701
77844
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (refract);
77702
77845
 
77846
+ /***/ },
77847
+
77848
+ /***/ 52645
77849
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
77850
+
77851
+ "use strict";
77852
+ __webpack_require__.r(__webpack_exports__);
77853
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
77854
+ /* harmony export */ CallbackElement: () => (/* reexport safe */ _elements_Callback_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
77855
+ /* harmony export */ ComponentsElement: () => (/* reexport safe */ _elements_Components_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]),
77856
+ /* harmony export */ ContactElement: () => (/* reexport safe */ _elements_Contact_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]),
77857
+ /* harmony export */ DiscriminatorElement: () => (/* reexport safe */ _elements_Discriminator_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]),
77858
+ /* harmony export */ EncodingElement: () => (/* reexport safe */ _elements_Encoding_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
77859
+ /* harmony export */ ExampleElement: () => (/* reexport safe */ _elements_Example_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
77860
+ /* harmony export */ ExternalDocumentationElement: () => (/* reexport safe */ _elements_ExternalDocumentation_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
77861
+ /* harmony export */ HeaderElement: () => (/* reexport safe */ _elements_Header_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
77862
+ /* harmony export */ InfoElement: () => (/* reexport safe */ _elements_Info_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]),
77863
+ /* harmony export */ JsonSchemaDialectElement: () => (/* reexport safe */ _elements_JsonSchemaDialect_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]),
77864
+ /* harmony export */ LicenseElement: () => (/* reexport safe */ _elements_License_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]),
77865
+ /* harmony export */ LinkElement: () => (/* reexport safe */ _elements_Link_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]),
77866
+ /* harmony export */ MediaTypeElement: () => (/* reexport safe */ _elements_MediaType_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]),
77867
+ /* harmony export */ OAuthFlowElement: () => (/* reexport safe */ _elements_OAuthFlow_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]),
77868
+ /* harmony export */ OAuthFlowsElement: () => (/* reexport safe */ _elements_OAuthFlows_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]),
77869
+ /* harmony export */ OpenApi3_1Element: () => (/* reexport safe */ _elements_OpenApi3_1_mjs__WEBPACK_IMPORTED_MODULE_18__["default"]),
77870
+ /* harmony export */ OpenapiElement: () => (/* reexport safe */ _elements_Openapi_mjs__WEBPACK_IMPORTED_MODULE_17__["default"]),
77871
+ /* harmony export */ OperationElement: () => (/* reexport safe */ _elements_Operation_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]),
77872
+ /* harmony export */ ParameterElement: () => (/* reexport safe */ _elements_Parameter_mjs__WEBPACK_IMPORTED_MODULE_20__["default"]),
77873
+ /* harmony export */ PathItemElement: () => (/* reexport safe */ _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_21__["default"]),
77874
+ /* harmony export */ PathsElement: () => (/* reexport safe */ _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_22__["default"]),
77875
+ /* harmony export */ ReferenceElement: () => (/* reexport safe */ _elements_Reference_mjs__WEBPACK_IMPORTED_MODULE_23__["default"]),
77876
+ /* harmony export */ RequestBodyElement: () => (/* reexport safe */ _elements_RequestBody_mjs__WEBPACK_IMPORTED_MODULE_24__["default"]),
77877
+ /* harmony export */ ResponseElement: () => (/* reexport safe */ _elements_Response_mjs__WEBPACK_IMPORTED_MODULE_25__["default"]),
77878
+ /* harmony export */ ResponsesElement: () => (/* reexport safe */ _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_26__["default"]),
77879
+ /* harmony export */ SchemaElement: () => (/* reexport safe */ _elements_Schema_mjs__WEBPACK_IMPORTED_MODULE_27__["default"]),
77880
+ /* harmony export */ SecurityRequirementElement: () => (/* reexport safe */ _elements_SecurityRequirement_mjs__WEBPACK_IMPORTED_MODULE_28__["default"]),
77881
+ /* harmony export */ SecuritySchemeElement: () => (/* reexport safe */ _elements_SecurityScheme_mjs__WEBPACK_IMPORTED_MODULE_29__["default"]),
77882
+ /* harmony export */ ServerElement: () => (/* reexport safe */ _elements_Server_mjs__WEBPACK_IMPORTED_MODULE_30__["default"]),
77883
+ /* harmony export */ ServerVariableElement: () => (/* reexport safe */ _elements_ServerVariable_mjs__WEBPACK_IMPORTED_MODULE_31__["default"]),
77884
+ /* harmony export */ TagElement: () => (/* reexport safe */ _elements_Tag_mjs__WEBPACK_IMPORTED_MODULE_32__["default"]),
77885
+ /* harmony export */ XmlElement: () => (/* reexport safe */ _elements_Xml_mjs__WEBPACK_IMPORTED_MODULE_33__["default"])
77886
+ /* harmony export */ });
77887
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60572);
77888
+ /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34606);
77889
+ /* harmony import */ var _elements_Callback_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30422);
77890
+ /* harmony import */ var _elements_Components_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(68772);
77891
+ /* harmony import */ var _elements_Contact_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16368);
77892
+ /* harmony import */ var _elements_Discriminator_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(13456);
77893
+ /* harmony import */ var _elements_Encoding_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67071);
77894
+ /* harmony import */ var _elements_Example_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91210);
77895
+ /* harmony import */ var _elements_ExternalDocumentation_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(82753);
77896
+ /* harmony import */ var _elements_Header_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(10391);
77897
+ /* harmony import */ var _elements_Info_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80064);
77898
+ /* harmony import */ var _elements_JsonSchemaDialect_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(66035);
77899
+ /* harmony import */ var _elements_License_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(10673);
77900
+ /* harmony import */ var _elements_Link_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(64720);
77901
+ /* harmony import */ var _elements_MediaType_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(91784);
77902
+ /* harmony import */ var _elements_OAuthFlow_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(73645);
77903
+ /* harmony import */ var _elements_OAuthFlows_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(28308);
77904
+ /* harmony import */ var _elements_Openapi_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(14540);
77905
+ /* harmony import */ var _elements_OpenApi3_1_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(81793);
77906
+ /* harmony import */ var _elements_Operation_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(54427);
77907
+ /* harmony import */ var _elements_Parameter_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(5849);
77908
+ /* harmony import */ var _elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(43360);
77909
+ /* harmony import */ var _elements_Paths_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(85652);
77910
+ /* harmony import */ var _elements_Reference_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(36539);
77911
+ /* harmony import */ var _elements_RequestBody_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(71387);
77912
+ /* harmony import */ var _elements_Response_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(51193);
77913
+ /* harmony import */ var _elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(77080);
77914
+ /* harmony import */ var _elements_Schema_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(26385);
77915
+ /* harmony import */ var _elements_SecurityRequirement_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(87051);
77916
+ /* harmony import */ var _elements_SecurityScheme_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(3719);
77917
+ /* harmony import */ var _elements_Server_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(93497);
77918
+ /* harmony import */ var _elements_ServerVariable_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(7929);
77919
+ /* harmony import */ var _elements_Tag_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(24224);
77920
+ /* harmony import */ var _elements_Xml_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(10931);
77921
+ /* harmony import */ var _specification_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(56110);
77922
+
77923
+
77924
+
77925
+ /**
77926
+ * OpenAPI 3.1 specification elements.
77927
+ */
77928
+
77929
+
77930
+
77931
+
77932
+
77933
+
77934
+
77935
+
77936
+
77937
+
77938
+
77939
+
77940
+
77941
+
77942
+
77943
+
77944
+
77945
+
77946
+
77947
+
77948
+
77949
+
77950
+
77951
+
77952
+
77953
+
77954
+
77955
+
77956
+
77957
+
77958
+
77959
+
77960
+
77961
+ /**
77962
+ * @public
77963
+ */
77964
+ // Resolve specification to dereference $ref pointers
77965
+ const resolvedSpec = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__.resolveSpecification)(_specification_mjs__WEBPACK_IMPORTED_MODULE_34__["default"]);
77966
+
77967
+ // Extract fixed fields as list of { name, alias?, $visitor }
77968
+ const getFixedFields = fixedFieldsSpec => {
77969
+ return Object.entries(fixedFieldsSpec).map(([name, fieldSpec]) => {
77970
+ if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(fieldSpec)) {
77971
+ return {
77972
+ name,
77973
+ ...fieldSpec
77974
+ };
77975
+ }
77976
+ return {
77977
+ name,
77978
+ $visitor: fieldSpec
77979
+ };
77980
+ });
77981
+ };
77982
+
77983
+ // OpenAPI 3.1 specification elements
77984
+ Object.defineProperty(_elements_OpenApi3_1_mjs__WEBPACK_IMPORTED_MODULE_18__["default"], 'fixedFields', {
77985
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.OpenApi.fixedFields),
77986
+ enumerable: true
77987
+ });
77988
+ Object.defineProperty(_elements_Info_mjs__WEBPACK_IMPORTED_MODULE_10__["default"], 'fixedFields', {
77989
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Info.fixedFields),
77990
+ enumerable: true
77991
+ });
77992
+ Object.defineProperty(_elements_Contact_mjs__WEBPACK_IMPORTED_MODULE_4__["default"], 'fixedFields', {
77993
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Contact.fixedFields),
77994
+ enumerable: true
77995
+ });
77996
+ Object.defineProperty(_elements_License_mjs__WEBPACK_IMPORTED_MODULE_12__["default"], 'fixedFields', {
77997
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.License.fixedFields),
77998
+ enumerable: true
77999
+ });
78000
+ Object.defineProperty(_elements_Server_mjs__WEBPACK_IMPORTED_MODULE_30__["default"], 'fixedFields', {
78001
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Server.fixedFields),
78002
+ enumerable: true
78003
+ });
78004
+ Object.defineProperty(_elements_ServerVariable_mjs__WEBPACK_IMPORTED_MODULE_31__["default"], 'fixedFields', {
78005
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.ServerVariable.fixedFields),
78006
+ enumerable: true
78007
+ });
78008
+ Object.defineProperty(_elements_Components_mjs__WEBPACK_IMPORTED_MODULE_3__["default"], 'fixedFields', {
78009
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Components.fixedFields),
78010
+ enumerable: true
78011
+ });
78012
+ Object.defineProperty(_elements_PathItem_mjs__WEBPACK_IMPORTED_MODULE_21__["default"], 'fixedFields', {
78013
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.PathItem.fixedFields),
78014
+ enumerable: true
78015
+ });
78016
+ Object.defineProperty(_elements_Operation_mjs__WEBPACK_IMPORTED_MODULE_19__["default"], 'fixedFields', {
78017
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Operation.fixedFields),
78018
+ enumerable: true
78019
+ });
78020
+ Object.defineProperty(_elements_ExternalDocumentation_mjs__WEBPACK_IMPORTED_MODULE_8__["default"], 'fixedFields', {
78021
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.ExternalDocumentation.fixedFields),
78022
+ enumerable: true
78023
+ });
78024
+ Object.defineProperty(_elements_Parameter_mjs__WEBPACK_IMPORTED_MODULE_20__["default"], 'fixedFields', {
78025
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Parameter.fixedFields),
78026
+ enumerable: true
78027
+ });
78028
+ Object.defineProperty(_elements_RequestBody_mjs__WEBPACK_IMPORTED_MODULE_24__["default"], 'fixedFields', {
78029
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.RequestBody.fixedFields),
78030
+ enumerable: true
78031
+ });
78032
+ Object.defineProperty(_elements_MediaType_mjs__WEBPACK_IMPORTED_MODULE_14__["default"], 'fixedFields', {
78033
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.MediaType.fixedFields),
78034
+ enumerable: true
78035
+ });
78036
+ Object.defineProperty(_elements_Encoding_mjs__WEBPACK_IMPORTED_MODULE_6__["default"], 'fixedFields', {
78037
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Encoding.fixedFields),
78038
+ enumerable: true
78039
+ });
78040
+ Object.defineProperty(_elements_Responses_mjs__WEBPACK_IMPORTED_MODULE_26__["default"], 'fixedFields', {
78041
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Responses.fixedFields),
78042
+ enumerable: true
78043
+ });
78044
+ Object.defineProperty(_elements_Response_mjs__WEBPACK_IMPORTED_MODULE_25__["default"], 'fixedFields', {
78045
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Response.fixedFields),
78046
+ enumerable: true
78047
+ });
78048
+ Object.defineProperty(_elements_Example_mjs__WEBPACK_IMPORTED_MODULE_7__["default"], 'fixedFields', {
78049
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Example.fixedFields),
78050
+ enumerable: true
78051
+ });
78052
+ Object.defineProperty(_elements_Link_mjs__WEBPACK_IMPORTED_MODULE_13__["default"], 'fixedFields', {
78053
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Link.fixedFields),
78054
+ enumerable: true
78055
+ });
78056
+ Object.defineProperty(_elements_Header_mjs__WEBPACK_IMPORTED_MODULE_9__["default"], 'fixedFields', {
78057
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Header.fixedFields),
78058
+ enumerable: true
78059
+ });
78060
+ Object.defineProperty(_elements_Tag_mjs__WEBPACK_IMPORTED_MODULE_32__["default"], 'fixedFields', {
78061
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Tag.fixedFields),
78062
+ enumerable: true
78063
+ });
78064
+ Object.defineProperty(_elements_Reference_mjs__WEBPACK_IMPORTED_MODULE_23__["default"], 'fixedFields', {
78065
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Reference.fixedFields),
78066
+ enumerable: true
78067
+ });
78068
+ Object.defineProperty(_elements_Schema_mjs__WEBPACK_IMPORTED_MODULE_27__["default"], 'fixedFields', {
78069
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Schema.fixedFields),
78070
+ enumerable: true
78071
+ });
78072
+ Object.defineProperty(_elements_Discriminator_mjs__WEBPACK_IMPORTED_MODULE_5__["default"], 'fixedFields', {
78073
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.Discriminator.fixedFields),
78074
+ enumerable: true
78075
+ });
78076
+ Object.defineProperty(_elements_Xml_mjs__WEBPACK_IMPORTED_MODULE_33__["default"], 'fixedFields', {
78077
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.XML.fixedFields),
78078
+ enumerable: true
78079
+ });
78080
+ Object.defineProperty(_elements_SecurityScheme_mjs__WEBPACK_IMPORTED_MODULE_29__["default"], 'fixedFields', {
78081
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.SecurityScheme.fixedFields),
78082
+ enumerable: true
78083
+ });
78084
+ Object.defineProperty(_elements_OAuthFlows_mjs__WEBPACK_IMPORTED_MODULE_16__["default"], 'fixedFields', {
78085
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.OAuthFlows.fixedFields),
78086
+ enumerable: true
78087
+ });
78088
+ Object.defineProperty(_elements_OAuthFlow_mjs__WEBPACK_IMPORTED_MODULE_15__["default"], 'fixedFields', {
78089
+ get: () => getFixedFields(resolvedSpec.visitors.document.objects.OAuthFlow.fixedFields),
78090
+ enumerable: true
78091
+ });
78092
+
78093
+
77703
78094
  /***/ },
77704
78095
 
77705
78096
  /***/ 68201
@@ -91863,23 +92254,23 @@ class BundleStrategy {
91863
92254
 
91864
92255
  /***/ },
91865
92256
 
91866
- /***/ 95416
92257
+ /***/ 27302
91867
92258
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
91868
92259
 
91869
92260
  "use strict";
91870
92261
  __webpack_require__.r(__webpack_exports__);
91871
92262
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
91872
- /* harmony export */ OpenAPI2BundleVisitor: () => (/* reexport safe */ _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
92263
+ /* harmony export */ Arazzo1BundleVisitor: () => (/* reexport safe */ _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
91873
92264
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
91874
92265
  /* harmony export */ });
91875
92266
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
91876
92267
  /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
91877
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3677);
91878
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26365);
92268
+ /* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53787);
92269
+ /* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28839);
91879
92270
  /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82302);
91880
92271
  /* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88526);
91881
92272
  /* harmony import */ var _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(73723);
91882
- /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(61210);
92273
+ /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89708);
91883
92274
 
91884
92275
 
91885
92276
 
@@ -91893,21 +92284,21 @@ __webpack_require__.r(__webpack_exports__);
91893
92284
  /**
91894
92285
  * @public
91895
92286
  */
91896
- class OpenAPI2BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
92287
+ class Arazzo1BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
91897
92288
  constructor(options) {
91898
92289
  super({
91899
92290
  ...(options ?? {}),
91900
- name: 'openapi-2'
92291
+ name: 'arazzo-1'
91901
92292
  });
91902
92293
  }
91903
92294
  canBundle(file) {
91904
92295
  // assert by media type
91905
92296
  if (file.mediaType !== 'text/plain') {
91906
- return _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
92297
+ return _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
91907
92298
  }
91908
92299
 
91909
92300
  // assert by inspecting ApiDOM
91910
- return (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_3__.isSwaggerElement)(file.parseResult?.result);
92301
+ return (0,_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_3__.isArazzoSpecification1Element)(file.parseResult?.result);
91911
92302
  }
91912
92303
  async bundle(file, options) {
91913
92304
  const immutableRefSet = options.bundle.refSet ?? new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]();
@@ -91960,11 +92351,11 @@ class OpenAPI2BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODUL
91960
92351
  }
91961
92352
  }
91962
92353
 
91963
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI2BundleStrategy);
92354
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Arazzo1BundleStrategy);
91964
92355
 
91965
92356
  /***/ },
91966
92357
 
91967
- /***/ 61210
92358
+ /***/ 89708
91968
92359
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
91969
92360
 
91970
92361
  "use strict";
@@ -91972,31 +92363,31 @@ __webpack_require__.r(__webpack_exports__);
91972
92363
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
91973
92364
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
91974
92365
  /* harmony export */ });
91975
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
92366
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87009);
91976
92367
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
91977
92368
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12111);
91978
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97071);
91979
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84660);
91980
- /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(37205);
91981
- /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44673);
91982
- /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16280);
91983
- /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80796);
91984
- /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12020);
91985
- /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61198);
91986
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(61500);
91987
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(86059);
91988
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(59014);
91989
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3498);
91990
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(26365);
91991
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(72880);
91992
- /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(60574);
91993
- /* harmony import */ var _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(89693);
91994
- /* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(34968);
91995
- /* harmony import */ var _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(55086);
91996
- /* harmony import */ var _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(10476);
91997
- /* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(18917);
91998
- /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(85533);
91999
- /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(82302);
92369
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84660);
92370
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(37205);
92371
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(44673);
92372
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16280);
92373
+ /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80796);
92374
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12020);
92375
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(61198);
92376
+ /* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(90016);
92377
+ /* harmony import */ var _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(41016);
92378
+ /* harmony import */ var _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(89693);
92379
+ /* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(34968);
92380
+ /* harmony import */ var _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(55086);
92381
+ /* harmony import */ var _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(10476);
92382
+ /* harmony import */ var _errors_EvaluationJsonSchemaUriError_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(22820);
92383
+ /* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(18917);
92384
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(85533);
92385
+ /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(82302);
92386
+ /* harmony import */ var _File_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(29217);
92387
+ /* harmony import */ var _dereference_strategies_arazzo_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(10533);
92388
+ /* harmony import */ var _dereference_strategies_arazzo_1_selectors_uri_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(92500);
92389
+ /* harmony import */ var _dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(42424);
92390
+ /* harmony import */ var _dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(29587);
92000
92391
  /* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(78814);
92001
92392
 
92002
92393
 
@@ -92012,34 +92403,19 @@ __webpack_require__.r(__webpack_exports__);
92012
92403
 
92013
92404
 
92014
92405
 
92406
+
92407
+
92408
+
92409
+
92410
+
92015
92411
  /**
92016
- * Maps the `referenced-element` meta value (set during refraction) to the
92017
- * top-level Swagger Object field where the referenced element should be
92018
- * hoisted. Unlike OpenAPI 3.x, OpenAPI 2.0 has no single Components Object;
92019
- * reusable definitions live directly under the document root. Field names are
92020
- * sourced from the Swagger Object fixed fields so they cannot drift from the
92412
+ * The Components Object field where embedded JSON Schema resources are hoisted.
92413
+ * Sourced from the Components Object fixed fields so it cannot drift from the
92021
92414
  * namespace definition.
92022
92415
  */
92023
- const sf = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__.fixedFields)(_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.SwaggerElement, {
92416
+ const cf = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_4__.fixedFields)(_speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_10__.ComponentsElement, {
92024
92417
  indexed: true
92025
92418
  });
92026
- const fieldByReferencedElement = {
92027
- schema: sf.definitions.name,
92028
- parameter: sf.parameters.name,
92029
- response: sf.responses.name
92030
- };
92031
-
92032
- /**
92033
- * Maps a top-level Swagger Object field to the named-content element the
92034
- * namespace uses for it, so a bundle-created field matches a parsed/refracted
92035
- * one (e.g. carries the `definitions` class) rather than being a generic
92036
- * object.
92037
- */
92038
- const fieldElementByField = {
92039
- [sf.definitions.name]: _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.DefinitionsElement,
92040
- [sf.parameters.name]: _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.ParametersDefinitionsElement,
92041
- [sf.responses.name]: _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.ResponsesDefinitionsElement
92042
- };
92043
92419
 
92044
92420
  /**
92045
92421
  * @public
@@ -92048,19 +92424,10 @@ const fieldElementByField = {
92048
92424
  /**
92049
92425
  * @public
92050
92426
  */
92051
- class OpenAPI2BundleVisitor {
92427
+ class Arazzo1BundleVisitor {
92052
92428
  reference;
92053
92429
  options;
92054
92430
 
92055
- /**
92056
- * The base URI (without hash) of the entry document. A reference is
92057
- * considered internal when it resolves to this URI and external otherwise.
92058
- * Derived from the shared refSet's root reference.
92059
- */
92060
- get entryURI() {
92061
- return _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.stripHash(this.reference.refSet?.rootRef?.uri ?? '');
92062
- }
92063
-
92064
92431
  /**
92065
92432
  * The entry parse result. Derived from the shared refSet's root reference.
92066
92433
  */
@@ -92069,9 +92436,9 @@ class OpenAPI2BundleVisitor {
92069
92436
  }
92070
92437
 
92071
92438
  /**
92072
- * The entry document element. Hoisted external fragments are placed into its
92073
- * top-level definition fields. The `canBundle` guard guarantees it is a
92074
- * SwaggerElement.
92439
+ * The entry document element. Embedded external schema resources are placed
92440
+ * into its `components.inputs` object. The `canBundle` guard guarantees it is
92441
+ * an ArazzoSpecification1Element.
92075
92442
  */
92076
92443
  get entryResult() {
92077
92444
  return this.entryParseResult.result;
@@ -92079,31 +92446,1309 @@ class OpenAPI2BundleVisitor {
92079
92446
 
92080
92447
  /**
92081
92448
  * Shared across the entry document and every external document visitor.
92082
- * Guarantees each external fragment is hoisted exactly once and gives us a
92083
- * stable internal pointer to rewrite every referencing element to.
92449
+ * Guarantees each external resource is embedded exactly once, keyed by its
92450
+ * resource URI.
92084
92451
  */
92085
92452
  assignments;
92086
92453
 
92087
92454
  /**
92088
- * Component names already reserved per definition field. Reserved before
92089
- * recursion so collision suffixing (`Pet`, `Pet-2`, ...) accounts for
92455
+ * Component names already reserved per Components Object field. Reserved
92456
+ * before recursion so collision suffixing (`Pet`, `Pet-2`, ...) accounts for
92090
92457
  * components that are still being bundled.
92091
92458
  */
92092
92459
  reservedNames;
92460
+ constructor({
92461
+ reference,
92462
+ options,
92463
+ assignments = new Map(),
92464
+ reservedNames = new Map()
92465
+ }) {
92466
+ this.reference = reference;
92467
+ this.options = options;
92468
+ this.assignments = assignments;
92469
+ this.reservedNames = reservedNames;
92470
+ }
92471
+ toBaseURI(uri) {
92472
+ return _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.resolve(this.reference.uri, _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.sanitize(_util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash(uri)));
92473
+ }
92474
+ async toReference(uri) {
92475
+ // detect maximum depth of resolution
92476
+ if (this.reference.depth >= this.options.resolve.maxDepth) {
92477
+ throw new _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_15__["default"](`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`, {
92478
+ maxDepth: this.options.resolve.maxDepth,
92479
+ uri: this.reference.uri
92480
+ });
92481
+ }
92482
+ const baseURI = this.toBaseURI(uri);
92483
+ const {
92484
+ refSet
92485
+ } = this.reference;
92486
+
92487
+ // we've already processed this Reference in past
92488
+ if (refSet.has(baseURI)) {
92489
+ return refSet.find(ref => ref.uri === baseURI);
92490
+ }
92491
+ const parseResult = await (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_18__["default"])(_util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.unsanitize(baseURI), {
92492
+ ...this.options,
92493
+ parse: {
92494
+ ...this.options.parse,
92495
+ mediaType: 'text/plain'
92496
+ }
92497
+ });
92498
+ const reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]({
92499
+ uri: baseURI,
92500
+ value: parseResult,
92501
+ depth: this.reference.depth + 1
92502
+ });
92503
+ refSet.add(reference);
92504
+ return reference;
92505
+ }
92093
92506
 
92094
92507
  /**
92095
- * Caches refracted fragments keyed by source element and target element type.
92096
- * The type is part of the key because the same source can be refracted into
92097
- * different semantic elements depending on the referencing context (e.g. a
92098
- * generic object referenced once as a Parameter and once as a Response).
92508
+ * Handles an error according to the `bundle.continueOnError` option.
92509
+ *
92510
+ * For new errors: wraps in UnresolvableReferenceError with structured
92511
+ * context. For errors already wrapped by a nested visitor: prepends the
92512
+ * current hop to the trace.
92513
+ *
92514
+ * Inner/intermediate visitors always throw to let the trace accumulate. Only
92515
+ * the entry document visitor respects continueOnError (callback/swallow/throw).
92099
92516
  */
92100
- refractCache;
92517
+ handleError(message, error, referencingElement, refFieldName, refFieldValue, visitorPath) {
92518
+ // a collision reported as `error` is a deliberate hard stop with no
92519
+ // resolution-failure analog, so pass it through unchanged. A maxDepth
92520
+ // breach (MaximumBundleDepthError, which also extends BundleError) is a
92521
+ // resolution failure and flows through below — wrapped and subject to
92522
+ // continueOnError, like dereferencing.
92523
+ if (error instanceof _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_12__["default"] && !(error instanceof _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_14__["default"])) {
92524
+ throw error;
92525
+ }
92526
+ const {
92527
+ continueOnError
92528
+ } = this.options.bundle;
92529
+ const isEntryDocument = _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
92530
+ const uri = this.reference.uri;
92531
+ const type = referencingElement.element;
92532
+ const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement);
92533
+ const location = visitorPath.formatPath();
92534
+ const hop = {
92535
+ uri,
92536
+ type,
92537
+ refFieldName,
92538
+ refFieldValue,
92539
+ location,
92540
+ codeFrame
92541
+ };
92542
+ let unresolvedError;
92543
+ if (error instanceof _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]) {
92544
+ // @ts-ignore
92545
+ error.trace = [hop, ...error.trace];
92546
+ unresolvedError = error;
92547
+ } else {
92548
+ unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_13__["default"](message, {
92549
+ cause: error,
92550
+ type,
92551
+ uri,
92552
+ location,
92553
+ codeFrame,
92554
+ refFieldName,
92555
+ refFieldValue,
92556
+ trace: []
92557
+ });
92558
+ }
92559
+ if (!isEntryDocument || continueOnError === false) throw unresolvedError;
92560
+ if (typeof continueOnError === 'function') continueOnError(unresolvedError);
92561
+ }
92101
92562
 
92102
92563
  /**
92103
- * Canonical URIs of Path Item Objects currently being inlined. Path Items
92104
- * are not a top-level definition field in OpenAPI 2.0, so the `assignments`
92105
- * map can't break their cycles. This stack guards against circular external
92106
- * Path Item references.
92564
+ * Lazily creates the Components Object (and the `inputs` field within it) on
92565
+ * the entry document, returning the field where a resource is embedded.
92566
+ */
92567
+ ensureInputsField() {
92568
+ const entryResult = this.entryResult;
92569
+ let components = entryResult.components;
92570
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(components)) {
92571
+ components = new _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_10__.ComponentsElement();
92572
+ entryResult.components = components;
92573
+ }
92574
+ let inputs = components.get(cf.inputs.name);
92575
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(inputs)) {
92576
+ inputs = new _speclynx_apidom_ns_arazzo_1__WEBPACK_IMPORTED_MODULE_11__["default"]();
92577
+ components.set(cf.inputs.name, inputs);
92578
+ }
92579
+ return inputs;
92580
+ }
92581
+
92582
+ /**
92583
+ * Computes the base component name (before collision suffixing) according to
92584
+ * the configured naming strategy.
92585
+ */
92586
+ baseName(element, baseURI) {
92587
+ // strategy specific options take precedence over the top-level bundle options
92588
+ const componentNamesStrategy = this.options.bundle.strategyOpts['arazzo-1']?.componentNamesStrategy ?? this.options.bundle.componentNamesStrategy;
92589
+ const fallback = _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.getBasename(baseURI) || 'Schema';
92590
+ if (typeof componentNamesStrategy === 'function') {
92591
+ const resolved = componentNamesStrategy({
92592
+ element,
92593
+ field: cf.inputs.name,
92594
+ jsonPointer: '',
92595
+ baseURI
92596
+ });
92597
+ if (typeof resolved === 'string' && resolved !== '') {
92598
+ return resolved;
92599
+ }
92600
+ return fallback;
92601
+ }
92602
+ if (componentNamesStrategy === 'title') {
92603
+ const title = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(element) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(element.get('title')) : undefined;
92604
+ if (typeof title === 'string' && title.trim() !== '') {
92605
+ const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.sanitizeComponentName)((0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.toPascalCase)(title));
92606
+ if (name !== '') return name;
92607
+ }
92608
+ // fall back to basename when no usable title is present
92609
+ }
92610
+ return fallback;
92611
+ }
92612
+
92613
+ /**
92614
+ * Computes a collision-free component name within `components.inputs`. A name
92615
+ * is taken if it's already placed in inputs or reserved by a component that is
92616
+ * still being bundled (reserved before recursion).
92617
+ */
92618
+ uniqueName(candidate) {
92619
+ const field = cf.inputs.name;
92620
+ const inputs = this.ensureInputsField();
92621
+ const reserved = this.reservedNames.get(field) ?? new Set();
92622
+ return (0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.uniqueName)(candidate, name => inputs.hasKey(name) || reserved.has(name));
92623
+ }
92624
+
92625
+ /**
92626
+ * Reports a collision-forced rename according to the configured severity.
92627
+ * A rename means two distinct targets resolved to the same name; each keeps
92628
+ * its own component (and origin), so report the rename per severity.
92629
+ */
92630
+ reportNameCollision(preferredName, componentName) {
92631
+ // strategy specific options take precedence over the top-level bundle options
92632
+ const onComponentNameCollision = this.options.bundle.strategyOpts['arazzo-1']?.onComponentNameCollision ?? this.options.bundle.onComponentNameCollision;
92633
+ if (componentName === preferredName || onComponentNameCollision === 'off') {
92634
+ return;
92635
+ }
92636
+ const message = `Component "${preferredName}" in components/${cf.inputs.name} is referenced with the same name but different content. Renamed to "${componentName}".`;
92637
+ if (onComponentNameCollision === 'error') {
92638
+ throw new _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_12__["default"](message);
92639
+ }
92640
+ const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"](message);
92641
+ annotation.classes.push('warning');
92642
+ annotation.code = 'bundle-component-name-collision';
92643
+ // append (never prepend) so the result element stays ahead of annotations
92644
+ this.entryParseResult.content.push(annotation);
92645
+ }
92646
+
92647
+ /**
92648
+ * JSON Schema Objects in Arazzo (used by Input Objects and inline schemas) are
92649
+ * a JSON Schema 2020-12 dialect — the only external reference type Arazzo
92650
+ * defines. They are bundled per the JSON Schema Compound Document rules: the
92651
+ * external schema RESOURCE is embedded verbatim into `components.inputs`
92652
+ * (carrying its `$id`), and the referencing `$ref` is left UNCHANGED — it
92653
+ * keeps resolving against the embedded resource's `$id`. This mirrors the
92654
+ * openapi-3-1 strategy's Schema Object handling.
92655
+ */
92656
+ async JSONSchemaElement(path) {
92657
+ const referencingElement = path.node;
92658
+
92659
+ // skip current referencing schema as $ref keyword was not defined
92660
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(referencingElement.$ref)) {
92661
+ return;
92662
+ }
92663
+ const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__["default"])(referencingElement.$ref);
92664
+ try {
92665
+ // compute baseURI using rules around $id and $ref keywords. The current
92666
+ // document's URI is the retrieval URI — derive it directly (not via
92667
+ // toReference) so an internal $ref needs no resolution and never trips the
92668
+ // resolve.maxDepth guard.
92669
+ const retrievalURI = this.reference.uri;
92670
+ const $refBaseURI = (0,_dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_24__.resolveSchema$refField)(retrievalURI, referencingElement);
92671
+ const $refBaseURIStrippedHash = _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash($refBaseURI);
92672
+ const file = new _File_mjs__WEBPACK_IMPORTED_MODULE_20__["default"]({
92673
+ uri: $refBaseURIStrippedHash
92674
+ });
92675
+ const isUnknownURI = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(r => r.canRead(file), this.options.resolve.resolvers);
92676
+ const isURL = !isUnknownURI;
92677
+ const isInternalReference = _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash(this.reference.uri) === $refBaseURIStrippedHash;
92678
+ const isExternalReference = !isInternalReference;
92679
+
92680
+ // internal Schema Object $refs resolve against the in-document $id graph;
92681
+ // leaving them untouched keeps that resolution valid. A JSON Schema $ref is
92682
+ // never normalized to a bare fragment.
92683
+ if (isInternalReference) {
92684
+ return;
92685
+ }
92686
+
92687
+ // honor the resolve.external switch
92688
+ if (!this.options.resolve.external && isExternalReference) {
92689
+ return;
92690
+ }
92691
+
92692
+ // detect maximum depth of bundling before fetching the external resource
92693
+ if (this.reference.depth >= this.options.bundle.maxDepth) {
92694
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_14__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
92695
+ maxDepth: this.options.bundle.maxDepth,
92696
+ uri: this.reference.uri
92697
+ });
92698
+ }
92699
+
92700
+ // locate the external schema resource the $ref targets, reusing the
92701
+ // dereference strategy's classification. First try to resolve the target
92702
+ // as a canonical URI / URL against the current document's $id graph; if
92703
+ // that fails, fall back to fetching the external document and resolving
92704
+ // the fragment there as a $anchor or JSON Pointer.
92705
+ let schemaReference = this.reference;
92706
+ try {
92707
+ const referenceAsSchema = (0,_dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_23__.maybeRefractToJSONSchemaElement)(schemaReference.value.result);
92708
+ (0,_dereference_strategies_arazzo_1_selectors_uri_mjs__WEBPACK_IMPORTED_MODULE_22__.evaluate)($refBaseURI, referenceAsSchema);
92709
+ } catch (error) {
92710
+ if (isURL && error instanceof _errors_EvaluationJsonSchemaUriError_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]) {
92711
+ if ((0,_dereference_strategies_arazzo_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_21__.isAnchor)((0,_dereference_strategies_arazzo_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_21__.uriToAnchor)($refBaseURI))) {
92712
+ schemaReference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.unsanitize($refBaseURI));
92713
+ const selector = (0,_dereference_strategies_arazzo_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_21__.uriToAnchor)($refBaseURI);
92714
+ const referenceAsSchema = (0,_dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_23__.maybeRefractToJSONSchemaElement)(schemaReference.value.result);
92715
+ (0,_dereference_strategies_arazzo_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_21__.evaluate)(selector, referenceAsSchema);
92716
+ } else {
92717
+ schemaReference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.unsanitize($refBaseURI));
92718
+ const selector = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.URIFragmentIdentifier.fromURIReference($refBaseURI);
92719
+ const referenceAsSchema = (0,_dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_23__.maybeRefractToJSONSchemaElement)(schemaReference.value.result);
92720
+ (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_8__.evaluate)(referenceAsSchema, selector);
92721
+ }
92722
+ } else {
92723
+ throw error;
92724
+ }
92725
+ }
92726
+
92727
+ // a $ref that resolves (by $id/$anchor/pointer) within the current document
92728
+ // is internal even when its URI form (e.g. a URN or absolute $id) is not a
92729
+ // bare fragment. Leave it untouched — it resolves against the in-document
92730
+ // $id graph, and embedding the current document into itself would be wrong.
92731
+ if (_util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash(schemaReference.uri) === _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash(this.reference.uri)) {
92732
+ return;
92733
+ }
92734
+
92735
+ // the resource to embed is the WHOLE external document (its root schema),
92736
+ // identified by its $id. A $ref into a fragment of the document embeds the
92737
+ // entire document resource once; the fragment keeps resolving against the
92738
+ // embedded $id.
92739
+ const resourceRoot = (0,_dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_23__.maybeRefractToJSONSchemaElement)(schemaReference.value.result);
92740
+ const resourceBaseURI = (0,_dereference_strategies_arazzo_1_util_mjs__WEBPACK_IMPORTED_MODULE_24__.resolveSchema$idField)(_util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash(schemaReference.uri), resourceRoot) ?? _util_url_mjs__WEBPACK_IMPORTED_MODULE_17__.stripHash(schemaReference.uri);
92741
+ const field = cf.inputs.name;
92742
+ const canonicalKey = `${field}\t${resourceBaseURI}`;
92743
+
92744
+ // resource already embedded (or being embedded) — leave the referencing
92745
+ // $ref untouched and stop. This also terminates circular external schema
92746
+ // references, since the assignment is reserved BEFORE recursion.
92747
+ if (this.assignments.has(canonicalKey)) {
92748
+ path.skip();
92749
+ return;
92750
+ }
92751
+
92752
+ // own a copy of the resource and ensure it carries a $id so the unchanged
92753
+ // $ref still resolves against it once embedded
92754
+ const embeddedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(resourceRoot);
92755
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(embeddedElement.$id)) {
92756
+ embeddedElement.set('$id', resourceBaseURI);
92757
+ }
92758
+
92759
+ // the embedded thing is the WHOLE resource (keyed by its $id), so its name
92760
+ // is derived from the resource URI
92761
+ const preferredName = this.baseName(embeddedElement, resourceBaseURI);
92762
+ const componentName = this.uniqueName(preferredName);
92763
+ this.reportNameCollision(preferredName, componentName);
92764
+
92765
+ // reserve the assignment and component name before recursing so circular
92766
+ // external schema references terminate
92767
+ this.assignments.set(canonicalKey, `#/components/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.escape)(componentName)}`);
92768
+ if (!this.reservedNames.has(field)) this.reservedNames.set(field, new Set());
92769
+ this.reservedNames.get(field).add(componentName);
92770
+
92771
+ // bundle external references contained within the embedded resource;
92772
+ // nested external resources land flat in the same components.inputs
92773
+ const visitor = new Arazzo1BundleVisitor({
92774
+ reference: schemaReference,
92775
+ options: this.options,
92776
+ assignments: this.assignments,
92777
+ reservedNames: this.reservedNames
92778
+ });
92779
+ const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_7__.traverseAsync)(embeddedElement, visitor, {
92780
+ mutable: true
92781
+ });
92782
+
92783
+ // annotate the embedded resource with info about its origin
92784
+ if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(bundledElement)) {
92785
+ bundledElement.meta.set('ref-origin', schemaReference.uri);
92786
+ }
92787
+
92788
+ // place the embedded resource into the entry document's components.inputs
92789
+ this.ensureInputsField().set(componentName, bundledElement);
92790
+
92791
+ // the referencing $ref is left UNCHANGED — it resolves against the
92792
+ // embedded resource's $id
92793
+ path.skip();
92794
+ } catch (error) {
92795
+ this.handleError(`Error while bundling JSON Schema Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, referencingElement, '$ref', $ref, path);
92796
+ path.skip();
92797
+ }
92798
+ }
92799
+ }
92800
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Arazzo1BundleVisitor);
92801
+
92802
+ /***/ },
92803
+
92804
+ /***/ 95416
92805
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
92806
+
92807
+ "use strict";
92808
+ __webpack_require__.r(__webpack_exports__);
92809
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
92810
+ /* harmony export */ OpenAPI2BundleVisitor: () => (/* reexport safe */ _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
92811
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
92812
+ /* harmony export */ });
92813
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
92814
+ /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
92815
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3677);
92816
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26365);
92817
+ /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82302);
92818
+ /* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88526);
92819
+ /* harmony import */ var _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(73723);
92820
+ /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(61210);
92821
+
92822
+
92823
+
92824
+
92825
+
92826
+
92827
+
92828
+ /**
92829
+ * @public
92830
+ */
92831
+ /**
92832
+ * @public
92833
+ */
92834
+ class OpenAPI2BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
92835
+ constructor(options) {
92836
+ super({
92837
+ ...(options ?? {}),
92838
+ name: 'openapi-2'
92839
+ });
92840
+ }
92841
+ canBundle(file) {
92842
+ // assert by media type
92843
+ if (file.mediaType !== 'text/plain') {
92844
+ return _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
92845
+ }
92846
+
92847
+ // assert by inspecting ApiDOM
92848
+ return (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_3__.isSwaggerElement)(file.parseResult?.result);
92849
+ }
92850
+ async bundle(file, options) {
92851
+ const immutableRefSet = options.bundle.refSet ?? new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]();
92852
+ const mutableRefSet = new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]();
92853
+ let refSet = immutableRefSet;
92854
+ let reference;
92855
+
92856
+ // determine the initial reference
92857
+ if (!immutableRefSet.has(file.uri)) {
92858
+ reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]({
92859
+ uri: file.uri,
92860
+ value: file.parseResult
92861
+ });
92862
+ immutableRefSet.add(reference);
92863
+ } else {
92864
+ // pre-computed refSet was provided as configuration option
92865
+ reference = immutableRefSet.find(ref => ref.uri === file.uri);
92866
+ }
92867
+
92868
+ /**
92869
+ * Clone refSet due the bundling process being mutable.
92870
+ * We don't want to mutate the original refSet and the references.
92871
+ */
92872
+ if (options.bundle.immutable) {
92873
+ immutableRefSet.refs.map(ref => new _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]({
92874
+ ...ref,
92875
+ value: (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(ref.value)
92876
+ })).forEach(ref => mutableRefSet.add(ref));
92877
+ reference = mutableRefSet.find(ref => ref.uri === file.uri);
92878
+ refSet = mutableRefSet;
92879
+ }
92880
+ const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
92881
+ reference: reference,
92882
+ options
92883
+ });
92884
+ await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__.traverseAsync)(refSet.rootRef.value, visitor, {
92885
+ mutable: true
92886
+ });
92887
+ const parseResult = reference.value;
92888
+
92889
+ /**
92890
+ * Release all memory if this refSet was not provided as a configuration option.
92891
+ * If provided as configuration option, then provider is responsible for cleanup.
92892
+ */
92893
+ if (options.bundle.refSet === null) {
92894
+ immutableRefSet.clean();
92895
+ }
92896
+ mutableRefSet.clean();
92897
+ return parseResult;
92898
+ }
92899
+ }
92900
+
92901
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI2BundleStrategy);
92902
+
92903
+ /***/ },
92904
+
92905
+ /***/ 61210
92906
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
92907
+
92908
+ "use strict";
92909
+ __webpack_require__.r(__webpack_exports__);
92910
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
92911
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
92912
+ /* harmony export */ });
92913
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
92914
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
92915
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12111);
92916
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97071);
92917
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84660);
92918
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(37205);
92919
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44673);
92920
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16280);
92921
+ /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80796);
92922
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(12020);
92923
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(61198);
92924
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(61500);
92925
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(86059);
92926
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(59014);
92927
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(3498);
92928
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(26365);
92929
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(72880);
92930
+ /* harmony import */ var _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(60574);
92931
+ /* harmony import */ var _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(89693);
92932
+ /* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(34968);
92933
+ /* harmony import */ var _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(55086);
92934
+ /* harmony import */ var _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(10476);
92935
+ /* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(18917);
92936
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(85533);
92937
+ /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(82302);
92938
+ /* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(78814);
92939
+
92940
+
92941
+
92942
+
92943
+
92944
+
92945
+
92946
+
92947
+
92948
+
92949
+
92950
+
92951
+
92952
+
92953
+ /**
92954
+ * Maps the `referenced-element` meta value (set during refraction) to the
92955
+ * top-level Swagger Object field where the referenced element should be
92956
+ * hoisted. Unlike OpenAPI 3.x, OpenAPI 2.0 has no single Components Object;
92957
+ * reusable definitions live directly under the document root. Field names are
92958
+ * sourced from the Swagger Object fixed fields so they cannot drift from the
92959
+ * namespace definition.
92960
+ */
92961
+ const sf = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__.fixedFields)(_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.SwaggerElement, {
92962
+ indexed: true
92963
+ });
92964
+ const fieldByReferencedElement = {
92965
+ schema: sf.definitions.name,
92966
+ parameter: sf.parameters.name,
92967
+ response: sf.responses.name
92968
+ };
92969
+
92970
+ /**
92971
+ * Maps a top-level Swagger Object field to the named-content element the
92972
+ * namespace uses for it, so a bundle-created field matches a parsed/refracted
92973
+ * one (e.g. carries the `definitions` class) rather than being a generic
92974
+ * object.
92975
+ */
92976
+ const fieldElementByField = {
92977
+ [sf.definitions.name]: _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.DefinitionsElement,
92978
+ [sf.parameters.name]: _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.ParametersDefinitionsElement,
92979
+ [sf.responses.name]: _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_17__.ResponsesDefinitionsElement
92980
+ };
92981
+
92982
+ /**
92983
+ * @public
92984
+ */
92985
+
92986
+ /**
92987
+ * @public
92988
+ */
92989
+ class OpenAPI2BundleVisitor {
92990
+ reference;
92991
+ options;
92992
+
92993
+ /**
92994
+ * The base URI (without hash) of the entry document. A reference is
92995
+ * considered internal when it resolves to this URI and external otherwise.
92996
+ * Derived from the shared refSet's root reference.
92997
+ */
92998
+ get entryURI() {
92999
+ return _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.stripHash(this.reference.refSet?.rootRef?.uri ?? '');
93000
+ }
93001
+
93002
+ /**
93003
+ * The entry parse result. Derived from the shared refSet's root reference.
93004
+ */
93005
+ get entryParseResult() {
93006
+ return this.reference.refSet.rootRef.value;
93007
+ }
93008
+
93009
+ /**
93010
+ * The entry document element. Hoisted external fragments are placed into its
93011
+ * top-level definition fields. The `canBundle` guard guarantees it is a
93012
+ * SwaggerElement.
93013
+ */
93014
+ get entryResult() {
93015
+ return this.entryParseResult.result;
93016
+ }
93017
+
93018
+ /**
93019
+ * Shared across the entry document and every external document visitor.
93020
+ * Guarantees each external fragment is hoisted exactly once and gives us a
93021
+ * stable internal pointer to rewrite every referencing element to.
93022
+ */
93023
+ assignments;
93024
+
93025
+ /**
93026
+ * Component names already reserved per definition field. Reserved before
93027
+ * recursion so collision suffixing (`Pet`, `Pet-2`, ...) accounts for
93028
+ * components that are still being bundled.
93029
+ */
93030
+ reservedNames;
93031
+
93032
+ /**
93033
+ * Caches refracted fragments keyed by source element and target element type.
93034
+ * The type is part of the key because the same source can be refracted into
93035
+ * different semantic elements depending on the referencing context (e.g. a
93036
+ * generic object referenced once as a Parameter and once as a Response).
93037
+ */
93038
+ refractCache;
93039
+
93040
+ /**
93041
+ * Canonical URIs of Path Item Objects currently being inlined. Path Items
93042
+ * are not a top-level definition field in OpenAPI 2.0, so the `assignments`
93043
+ * map can't break their cycles. This stack guards against circular external
93044
+ * Path Item references.
93045
+ */
93046
+ inlineStack;
93047
+ constructor({
93048
+ reference,
93049
+ options,
93050
+ assignments = new Map(),
93051
+ reservedNames = new Map(),
93052
+ refractCache = new WeakMap(),
93053
+ inlineStack = new Set()
93054
+ }) {
93055
+ this.reference = reference;
93056
+ this.options = options;
93057
+ this.inlineStack = inlineStack;
93058
+ this.assignments = assignments;
93059
+ this.reservedNames = reservedNames;
93060
+ this.refractCache = refractCache;
93061
+ }
93062
+ getRefracted(source, type) {
93063
+ return this.refractCache.get(source)?.get(type);
93064
+ }
93065
+ setRefracted(source, type, refracted) {
93066
+ let byType = this.refractCache.get(source);
93067
+ if (byType === undefined) {
93068
+ byType = new Map();
93069
+ this.refractCache.set(source, byType);
93070
+ }
93071
+ byType.set(type, refracted);
93072
+ }
93073
+ toBaseURI(uri) {
93074
+ return _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.resolve(this.reference.uri, _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.sanitize(_util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.stripHash(uri)));
93075
+ }
93076
+ async toReference(uri) {
93077
+ // detect maximum depth of resolution
93078
+ if (this.reference.depth >= this.options.resolve.maxDepth) {
93079
+ throw new _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_21__["default"](`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`, {
93080
+ maxDepth: this.options.resolve.maxDepth,
93081
+ uri: this.reference.uri
93082
+ });
93083
+ }
93084
+ const baseURI = this.toBaseURI(uri);
93085
+ const {
93086
+ refSet
93087
+ } = this.reference;
93088
+
93089
+ // we've already processed this Reference in past
93090
+ if (refSet.has(baseURI)) {
93091
+ return refSet.find((0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(baseURI, 'uri'));
93092
+ }
93093
+ const parseResult = await (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_23__["default"])(_util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.unsanitize(baseURI), {
93094
+ ...this.options,
93095
+ parse: {
93096
+ ...this.options.parse,
93097
+ mediaType: 'text/plain'
93098
+ }
93099
+ });
93100
+ const reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_24__["default"]({
93101
+ uri: baseURI,
93102
+ value: parseResult,
93103
+ depth: this.reference.depth + 1
93104
+ });
93105
+ refSet.add(reference);
93106
+ return reference;
93107
+ }
93108
+
93109
+ /**
93110
+ * Normalizes a self-reference (e.g. `./root.json#/definitions/Pet`)
93111
+ * to a bare fragment (`#/definitions/Pet`) so the bundled document stays
93112
+ * transferable. Bare fragments are returned unchanged.
93113
+ */
93114
+ normalizeSelfReference(ref) {
93115
+ return ref.startsWith('#') ? ref : _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.getHash(ref);
93116
+ }
93117
+
93118
+ /**
93119
+ * Handles an error according to the `bundle.continueOnError` option.
93120
+ *
93121
+ * For new errors: wraps in UnresolvableReferenceError with structured
93122
+ * context. For errors already wrapped by a nested visitor: prepends the
93123
+ * current hop to the trace.
93124
+ *
93125
+ * Inner/intermediate visitors always throw to let the trace accumulate. Only
93126
+ * the entry document visitor respects continueOnError (callback/swallow/throw).
93127
+ */
93128
+ handleError(message, error, referencingElement, refFieldName, refFieldValue, visitorPath) {
93129
+ // a collision reported as `error` is a deliberate hard stop with no
93130
+ // resolution-failure analog, so pass it through unchanged. A maxDepth
93131
+ // breach (MaximumBundleDepthError, which also extends BundleError) is a
93132
+ // resolution failure and flows through below — wrapped and subject to
93133
+ // continueOnError, like dereferencing.
93134
+ if (error instanceof _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_18__["default"] && !(error instanceof _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__["default"])) {
93135
+ throw error;
93136
+ }
93137
+ const {
93138
+ continueOnError
93139
+ } = this.options.bundle;
93140
+ const isEntryDocument = _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
93141
+ const uri = this.reference.uri;
93142
+ const type = referencingElement.element;
93143
+ const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(referencingElement);
93144
+ const location = visitorPath.formatPath();
93145
+ const hop = {
93146
+ uri,
93147
+ type,
93148
+ refFieldName,
93149
+ refFieldValue,
93150
+ location,
93151
+ codeFrame
93152
+ };
93153
+ let unresolvedError;
93154
+ if (error instanceof _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]) {
93155
+ // @ts-ignore
93156
+ error.trace = [hop, ...error.trace];
93157
+ unresolvedError = error;
93158
+ } else {
93159
+ unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_19__["default"](message, {
93160
+ cause: error,
93161
+ type,
93162
+ uri,
93163
+ location,
93164
+ codeFrame,
93165
+ refFieldName,
93166
+ refFieldValue,
93167
+ trace: []
93168
+ });
93169
+ }
93170
+ if (!isEntryDocument || continueOnError === false) throw unresolvedError;
93171
+ if (typeof continueOnError === 'function') continueOnError(unresolvedError);
93172
+ }
93173
+
93174
+ /**
93175
+ * Lazily creates the requested top-level definition field on the entry
93176
+ * document, returning the field where a fragment is hoisted.
93177
+ */
93178
+ ensureField(field) {
93179
+ const entryResult = this.entryResult;
93180
+ let fieldElement = entryResult.get(field);
93181
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(fieldElement)) {
93182
+ const FieldElement = fieldElementByField[field] ?? _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"];
93183
+ fieldElement = new FieldElement();
93184
+ entryResult.set(field, fieldElement);
93185
+ }
93186
+ return fieldElement;
93187
+ }
93188
+
93189
+ /**
93190
+ * Derives a component name from the referenced JSON Pointer's last token,
93191
+ * falling back to the referenced file's basename.
93192
+ */
93193
+ basenameOf(jsonPointer, baseURI) {
93194
+ const tokens = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.parse)(jsonPointer).tree;
93195
+ const lastToken = tokens.length > 0 ? tokens[tokens.length - 1] : '';
93196
+ return lastToken || _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.getBasename(baseURI) || 'Schema';
93197
+ }
93198
+
93199
+ /**
93200
+ * Computes the base component name (before collision suffixing) according to
93201
+ * the configured naming strategy.
93202
+ */
93203
+ baseName(element, field, jsonPointer, baseURI) {
93204
+ // strategy specific options take precedence over the top-level bundle options
93205
+ const componentNamesStrategy = this.options.bundle.strategyOpts['openapi-2']?.componentNamesStrategy ?? this.options.bundle.componentNamesStrategy;
93206
+ if (typeof componentNamesStrategy === 'function') {
93207
+ const resolved = componentNamesStrategy({
93208
+ element,
93209
+ field,
93210
+ jsonPointer,
93211
+ baseURI
93212
+ });
93213
+ if (typeof resolved === 'string' && resolved !== '') {
93214
+ return resolved;
93215
+ }
93216
+ return this.basenameOf(jsonPointer, baseURI);
93217
+ }
93218
+ if (componentNamesStrategy === 'title') {
93219
+ const title = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(element) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(element.get('title')) : undefined;
93220
+ if (typeof title === 'string' && title.trim() !== '') {
93221
+ const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.sanitizeComponentName)((0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.toPascalCase)(title));
93222
+ if (name !== '') return name;
93223
+ }
93224
+ // fall back to basename when no usable title is present
93225
+ }
93226
+ return this.basenameOf(jsonPointer, baseURI);
93227
+ }
93228
+
93229
+ /**
93230
+ * Computes a collision-free component name within the target field. A name is
93231
+ * taken if it's already placed in the field or reserved by a component that
93232
+ * is still being bundled (reserved before recursion).
93233
+ */
93234
+ uniqueName(candidate, field) {
93235
+ const fieldElement = this.ensureField(field);
93236
+ const reserved = this.reservedNames.get(field) ?? new Set();
93237
+ return (0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.uniqueName)(candidate, name => fieldElement.hasKey(name) || reserved.has(name));
93238
+ }
93239
+
93240
+ /**
93241
+ * Bundles a Reference Object (parameters/responses) or a JSON Reference
93242
+ * Object (schemas). The two reference flavors differ only in their predicate
93243
+ * and refraction helpers, so the shared logic is parameterized here.
93244
+ */
93245
+ async bundleReference(path, referencingElement, isSemanticReference, isReferenceLike, refractReferenceFn, label) {
93246
+ const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
93247
+ const retrievalURI = this.toBaseURI($ref);
93248
+ const isInternalReference = this.entryURI === retrievalURI;
93249
+ const isExternalReference = !isInternalReference;
93250
+ if (isInternalReference) {
93251
+ // normalize self-references to a bare fragment so the bundled
93252
+ // document stays transferable; bare fragments are left untouched
93253
+ referencingElement.set('$ref', this.normalizeSelfReference($ref));
93254
+ path.skip();
93255
+ return;
93256
+ }
93257
+
93258
+ // honor the resolve.external switch
93259
+ if (!this.options.resolve.external && isExternalReference) {
93260
+ path.skip();
93261
+ return;
93262
+ }
93263
+ const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.resolve(retrievalURI, $ref);
93264
+ const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.URIFragmentIdentifier.fromURIReference($refBaseURI);
93265
+
93266
+ // the target field depends on the referencing context, so it's part of the
93267
+ // identity: the same external target referenced as e.g. both a parameter and
93268
+ // a response must be hoisted into both fields. The refractor sets
93269
+ // `referenced-element` for every Reference Object position; the `schema`
93270
+ // fallback is a defensive default for the (unexpected) untagged case.
93271
+ const referencedElementType = referencingElement.meta.get('referenced-element');
93272
+ const field = fieldByReferencedElement[referencedElementType] ?? fieldByReferencedElement.schema;
93273
+ const canonicalKey = `${field}\t${retrievalURI}#${jsonPointer}`;
93274
+
93275
+ // already hoisted (or being hoisted) — just rewrite the pointer.
93276
+ //
93277
+ // this is also how circular references terminate: the assignment is
93278
+ // reserved BEFORE recursing into the fragment (see below), so a reference
93279
+ // that cycles back (directly or indirectly) finds its pointer already
93280
+ // reserved here and is rewritten without recursing. Cycles are deliberately
93281
+ // preserved as internal `$ref`s pointing at each other — that is valid,
93282
+ // serializable output; resolving the cycle (if desired) is dereferencing's
93283
+ // job, not bundling's.
93284
+ if (this.assignments.has(canonicalKey)) {
93285
+ referencingElement.set('$ref', this.assignments.get(canonicalKey));
93286
+ path.skip();
93287
+ return;
93288
+ }
93289
+ try {
93290
+ // detect maximum depth of bundling
93291
+ if (this.reference.depth >= this.options.bundle.maxDepth) {
93292
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
93293
+ maxDepth: this.options.bundle.maxDepth,
93294
+ uri: this.reference.uri
93295
+ });
93296
+ }
93297
+ const reference = await this.toReference($ref);
93298
+
93299
+ // possibly non-semantic fragment
93300
+ let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.evaluate)(reference.value.result, jsonPointer);
93301
+
93302
+ // apply semantics to the fragment so nested references become Reference Objects
93303
+ if (referencedElement.element !== referencedElementType && !isSemanticReference(referencedElement)) {
93304
+ const cached = this.getRefracted(referencedElement, referencedElementType);
93305
+ if (cached !== undefined) {
93306
+ referencedElement = cached;
93307
+ } else if (isReferenceLike(referencedElement)) {
93308
+ const sourceElement = referencedElement;
93309
+ referencedElement = refractReferenceFn(referencedElement);
93310
+ referencedElement.meta.set('referenced-element', referencedElementType);
93311
+ this.setRefracted(sourceElement, referencedElementType, referencedElement);
93312
+ } else {
93313
+ const sourceElement = referencedElement;
93314
+ referencedElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__["default"])(referencedElement, {
93315
+ element: referencedElementType
93316
+ });
93317
+ this.setRefracted(sourceElement, referencedElementType, referencedElement);
93318
+ }
93319
+ }
93320
+ const preferredName = this.baseName(referencedElement, field, jsonPointer, retrievalURI);
93321
+ const componentName = this.uniqueName(preferredName, field);
93322
+ const internalPointer = `#/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.escape)(componentName)}`;
93323
+
93324
+ // a rename means two distinct targets resolved to the same name; each
93325
+ // keeps its own component (and origin), so report the rename per severity.
93326
+ // strategy specific options take precedence over the top-level bundle options
93327
+ const onComponentNameCollision = this.options.bundle.strategyOpts['openapi-2']?.onComponentNameCollision ?? this.options.bundle.onComponentNameCollision;
93328
+ if (componentName !== preferredName && onComponentNameCollision !== 'off') {
93329
+ const message = `Component "${preferredName}" in ${field} is referenced with the same name but different content. Renamed to "${componentName}".`;
93330
+ if (onComponentNameCollision === 'error') {
93331
+ throw new _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_18__["default"](message);
93332
+ }
93333
+ const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](message);
93334
+ annotation.classes.push('warning');
93335
+ annotation.code = 'bundle-component-name-collision';
93336
+ // append (never prepend) so the result element stays ahead of annotations
93337
+ this.entryParseResult.content.push(annotation);
93338
+ }
93339
+
93340
+ // reserve the assignment and component name before recursing so cyclic
93341
+ // references terminate
93342
+ this.assignments.set(canonicalKey, internalPointer);
93343
+ if (!this.reservedNames.has(field)) this.reservedNames.set(field, new Set());
93344
+ this.reservedNames.get(field).add(componentName);
93345
+
93346
+ // own a copy of the fragment and bundle its own external references
93347
+ const hoistedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
93348
+ const visitor = new OpenAPI2BundleVisitor({
93349
+ reference,
93350
+ options: this.options,
93351
+ assignments: this.assignments,
93352
+ reservedNames: this.reservedNames,
93353
+ refractCache: this.refractCache,
93354
+ inlineStack: this.inlineStack
93355
+ });
93356
+ const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverseAsync)(hoistedElement, visitor, {
93357
+ mutable: true
93358
+ });
93359
+
93360
+ // annotate the hoisted fragment with info about its origin
93361
+ if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(bundledElement)) {
93362
+ bundledElement.meta.set('ref-origin', reference.uri);
93363
+ }
93364
+
93365
+ // place the bundled fragment into the entry document's definitions
93366
+ this.ensureField(field).set(componentName, bundledElement);
93367
+
93368
+ // rewrite the referencing element to point at the hoisted fragment
93369
+ referencingElement.set('$ref', internalPointer);
93370
+ path.skip();
93371
+ } catch (error) {
93372
+ this.handleError(`Error while bundling ${label}. Cannot resolve $ref "${$ref}": ${error.message}`, error, referencingElement, '$ref', $ref, path);
93373
+ path.skip();
93374
+ }
93375
+ }
93376
+
93377
+ /**
93378
+ * Reference Object covers reusable Parameter and Response Objects, which are
93379
+ * hoisted into the top-level `parameters` and `responses` fields.
93380
+ */
93381
+ async ReferenceElement(path) {
93382
+ await this.bundleReference(path, path.node, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_15__.isReferenceElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_16__.isReferenceLikeElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__.refractReference, 'Reference Object');
93383
+ }
93384
+
93385
+ /**
93386
+ * JSON Reference Object covers reusable Schema Objects, which are hoisted
93387
+ * into the top-level `definitions` field.
93388
+ */
93389
+ async JSONReferenceElement(path) {
93390
+ await this.bundleReference(path, path.node, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_12__.isJSONReferenceElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_14__.isJSONReferenceLikeElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_11__.refractJSONReference, 'JSON Reference Object');
93391
+ }
93392
+
93393
+ /**
93394
+ * Path Item Object is not a top-level definition field in OpenAPI 2.0, so an
93395
+ * external Path Item reference cannot be hoisted; it is inlined in place
93396
+ * instead, after bundling its own external references.
93397
+ */
93398
+ async PathItemElement(path) {
93399
+ const pathItemElement = path.node;
93400
+
93401
+ // ignore Path Item Objects without a $ref field
93402
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(pathItemElement.$ref)) {
93403
+ return;
93404
+ }
93405
+ const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(pathItemElement.$ref);
93406
+ const retrievalURI = this.toBaseURI($ref);
93407
+ const isInternalReference = this.entryURI === retrievalURI;
93408
+ const isExternalReference = !isInternalReference;
93409
+ if (isInternalReference) {
93410
+ // normalize self-references to a bare fragment so the bundled
93411
+ // document stays transferable; bare fragments are left untouched
93412
+ pathItemElement.set('$ref', this.normalizeSelfReference($ref));
93413
+ return;
93414
+ }
93415
+
93416
+ // honor the resolve.external switch
93417
+ if (!this.options.resolve.external && isExternalReference) {
93418
+ return;
93419
+ }
93420
+ const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.resolve(retrievalURI, $ref);
93421
+ const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.URIFragmentIdentifier.fromURIReference($refBaseURI);
93422
+ const canonicalKey = `${retrievalURI}#${jsonPointer}`;
93423
+
93424
+ // a circular external Path Item reference cannot be inlined without
93425
+ // recursing forever; leave the $ref in place to break the cycle
93426
+ if (this.inlineStack.has(canonicalKey)) {
93427
+ return;
93428
+ }
93429
+ try {
93430
+ // detect maximum depth of bundling
93431
+ if (this.reference.depth >= this.options.bundle.maxDepth) {
93432
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
93433
+ maxDepth: this.options.bundle.maxDepth,
93434
+ uri: this.reference.uri
93435
+ });
93436
+ }
93437
+ const reference = await this.toReference($ref);
93438
+ let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.evaluate)(reference.value.result, jsonPointer);
93439
+
93440
+ // apply Path Item semantics to the referenced fragment
93441
+ if (!(0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_15__.isPathItemElement)(referencedElement)) {
93442
+ const cached = this.getRefracted(referencedElement, 'pathItem');
93443
+ if (cached !== undefined) {
93444
+ referencedElement = cached;
93445
+ } else {
93446
+ const sourceElement = referencedElement;
93447
+ referencedElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__.refractPathItem)(referencedElement);
93448
+ this.setRefracted(sourceElement, 'pathItem', referencedElement);
93449
+ }
93450
+ }
93451
+
93452
+ // own a copy and bundle the external references it contains
93453
+ const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
93454
+ this.inlineStack.add(canonicalKey);
93455
+ const visitor = new OpenAPI2BundleVisitor({
93456
+ reference,
93457
+ options: this.options,
93458
+ assignments: this.assignments,
93459
+ reservedNames: this.reservedNames,
93460
+ refractCache: this.refractCache,
93461
+ inlineStack: this.inlineStack
93462
+ });
93463
+ let bundledElement;
93464
+ try {
93465
+ bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverseAsync)(inlinedElement, visitor, {
93466
+ mutable: true
93467
+ });
93468
+ } finally {
93469
+ this.inlineStack.delete(canonicalKey);
93470
+ }
93471
+
93472
+ // merge sibling fields from the referencing Path Item over the referenced
93473
+ // one. The referencing `$ref` is being resolved away and is skipped; the
93474
+ // referenced element keeps its own `$ref` if one survived (i.e. it was
93475
+ // left in place to break a circular external Path Item chain).
93476
+ pathItemElement.forEach((_value, keyElement, item) => {
93477
+ const key = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(keyElement);
93478
+ if (key === '$ref') return;
93479
+ bundledElement.remove(key);
93480
+ bundledElement.content.push(item);
93481
+ });
93482
+ bundledElement.meta.set('ref-origin', reference.uri);
93483
+ path.replaceWith(bundledElement);
93484
+ } catch (error) {
93485
+ this.handleError(`Error while bundling Path Item Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, pathItemElement, '$ref', $ref, path);
93486
+ }
93487
+ }
93488
+ }
93489
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI2BundleVisitor);
93490
+
93491
+ /***/ },
93492
+
93493
+ /***/ 5138
93494
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
93495
+
93496
+ "use strict";
93497
+ __webpack_require__.r(__webpack_exports__);
93498
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
93499
+ /* harmony export */ OpenAPI3_0BundleVisitor: () => (/* reexport safe */ _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
93500
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
93501
+ /* harmony export */ });
93502
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
93503
+ /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
93504
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
93505
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32131);
93506
+ /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82302);
93507
+ /* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88526);
93508
+ /* harmony import */ var _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(73723);
93509
+ /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98968);
93510
+
93511
+
93512
+
93513
+
93514
+
93515
+
93516
+
93517
+ /**
93518
+ * @public
93519
+ */
93520
+ /**
93521
+ * @public
93522
+ */
93523
+ class OpenAPI3_0BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
93524
+ constructor(options) {
93525
+ super({
93526
+ ...(options ?? {}),
93527
+ name: 'openapi-3-0'
93528
+ });
93529
+ }
93530
+ canBundle(file) {
93531
+ // assert by media type
93532
+ if (file.mediaType !== 'text/plain') {
93533
+ return _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
93534
+ }
93535
+
93536
+ // assert by inspecting ApiDOM
93537
+ return (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__.isOpenApi3_0Element)(file.parseResult?.result);
93538
+ }
93539
+ async bundle(file, options) {
93540
+ const immutableRefSet = options.bundle.refSet ?? new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]();
93541
+ const mutableRefSet = new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]();
93542
+ let refSet = immutableRefSet;
93543
+ let reference;
93544
+
93545
+ // determine the initial reference
93546
+ if (!immutableRefSet.has(file.uri)) {
93547
+ reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]({
93548
+ uri: file.uri,
93549
+ value: file.parseResult
93550
+ });
93551
+ immutableRefSet.add(reference);
93552
+ } else {
93553
+ // pre-computed refSet was provided as configuration option
93554
+ reference = immutableRefSet.find(ref => ref.uri === file.uri);
93555
+ }
93556
+
93557
+ /**
93558
+ * Clone refSet due the bundling process being mutable.
93559
+ * We don't want to mutate the original refSet and the references.
93560
+ */
93561
+ if (options.bundle.immutable) {
93562
+ immutableRefSet.refs.map(ref => new _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]({
93563
+ ...ref,
93564
+ value: (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(ref.value)
93565
+ })).forEach(ref => mutableRefSet.add(ref));
93566
+ reference = mutableRefSet.find(ref => ref.uri === file.uri);
93567
+ refSet = mutableRefSet;
93568
+ }
93569
+ const visitor = new _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
93570
+ reference: reference,
93571
+ options
93572
+ });
93573
+ await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__.traverseAsync)(refSet.rootRef.value, visitor, {
93574
+ mutable: true
93575
+ });
93576
+ const parseResult = reference.value;
93577
+
93578
+ /**
93579
+ * Release all memory if this refSet was not provided as a configuration option.
93580
+ * If provided as configuration option, then provider is responsible for cleanup.
93581
+ */
93582
+ if (options.bundle.refSet === null) {
93583
+ immutableRefSet.clean();
93584
+ }
93585
+ mutableRefSet.clean();
93586
+ return parseResult;
93587
+ }
93588
+ }
93589
+
93590
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI3_0BundleStrategy);
93591
+
93592
+ /***/ },
93593
+
93594
+ /***/ 98968
93595
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
93596
+
93597
+ "use strict";
93598
+ __webpack_require__.r(__webpack_exports__);
93599
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
93600
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
93601
+ /* harmony export */ });
93602
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
93603
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
93604
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12111);
93605
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97071);
93606
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84660);
93607
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(37205);
93608
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44673);
93609
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16280);
93610
+ /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44641);
93611
+ /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80796);
93612
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(12020);
93613
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(61198);
93614
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(30609);
93615
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(64708);
93616
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(32131);
93617
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21314);
93618
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29881);
93619
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(23806);
93620
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(23031);
93621
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(63842);
93622
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(87455);
93623
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(55122);
93624
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(71117);
93625
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(72257);
93626
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(69511);
93627
+ /* harmony import */ var _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(89693);
93628
+ /* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(34968);
93629
+ /* harmony import */ var _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(55086);
93630
+ /* harmony import */ var _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(10476);
93631
+ /* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(18917);
93632
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(85533);
93633
+ /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(82302);
93634
+ /* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(78814);
93635
+
93636
+
93637
+
93638
+
93639
+
93640
+
93641
+
93642
+
93643
+
93644
+
93645
+
93646
+
93647
+
93648
+
93649
+
93650
+ /**
93651
+ * Maps the `referenced-element` meta value (set during refraction) to the
93652
+ * Components Object field where the referenced element should be hoisted.
93653
+ * Field names are sourced from the Components Object fixed fields so they
93654
+ * cannot drift from the namespace definition.
93655
+ */
93656
+ const cf = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__.fixedFields)(_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__["default"], {
93657
+ indexed: true
93658
+ });
93659
+ const componentFieldByReferencedElement = {
93660
+ schema: cf.schemas.name,
93661
+ response: cf.responses.name,
93662
+ parameter: cf.parameters.name,
93663
+ example: cf.examples.name,
93664
+ requestBody: cf.requestBodies.name,
93665
+ header: cf.headers.name,
93666
+ securityScheme: cf.securitySchemes.name,
93667
+ link: cf.links.name,
93668
+ callback: cf.callbacks.name
93669
+ };
93670
+
93671
+ /**
93672
+ * Maps a Components Object field to the named-content element the namespace
93673
+ * uses for it, so a bundle-created field matches a parsed/refracted one
93674
+ * (e.g. carries the `components-schemas` class) rather than being a generic
93675
+ * object.
93676
+ */
93677
+ const componentFieldElementByField = {
93678
+ [cf.schemas.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_23__["default"],
93679
+ [cf.responses.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_22__["default"],
93680
+ [cf.parameters.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_20__["default"],
93681
+ [cf.examples.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_17__["default"],
93682
+ [cf.requestBodies.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_21__["default"],
93683
+ [cf.headers.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_18__["default"],
93684
+ [cf.securitySchemes.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_24__["default"],
93685
+ [cf.links.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_19__["default"],
93686
+ [cf.callbacks.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_16__["default"]
93687
+ };
93688
+
93689
+ /**
93690
+ * @public
93691
+ */
93692
+
93693
+ /**
93694
+ * @public
93695
+ */
93696
+ class OpenAPI3_0BundleVisitor {
93697
+ reference;
93698
+ options;
93699
+
93700
+ /**
93701
+ * The base URI (without hash) of the entry document. A reference is
93702
+ * considered internal when it resolves to this URI and external otherwise.
93703
+ * Derived from the shared refSet's root reference.
93704
+ */
93705
+ get entryURI() {
93706
+ return _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.stripHash(this.reference.refSet?.rootRef?.uri ?? '');
93707
+ }
93708
+
93709
+ /**
93710
+ * The entry parse result. Derived from the shared refSet's root reference.
93711
+ */
93712
+ get entryParseResult() {
93713
+ return this.reference.refSet.rootRef.value;
93714
+ }
93715
+
93716
+ /**
93717
+ * The entry document element. Hoisted external fragments are placed into its
93718
+ * `components` object. The `canBundle` guard guarantees it is an
93719
+ * OpenApi3_0Element.
93720
+ */
93721
+ get entryResult() {
93722
+ return this.entryParseResult.result;
93723
+ }
93724
+
93725
+ /**
93726
+ * Shared across the entry document and every external document visitor.
93727
+ * Guarantees each external fragment is hoisted exactly once and gives us a
93728
+ * stable internal pointer to rewrite every referencing element to.
93729
+ */
93730
+ assignments;
93731
+
93732
+ /**
93733
+ * Component names already reserved per Components Object field. Reserved
93734
+ * before recursion so collision suffixing (`Pet`, `Pet-2`, ...) accounts for
93735
+ * components that are still being bundled.
93736
+ */
93737
+ reservedNames;
93738
+
93739
+ /**
93740
+ * Caches refracted fragments keyed by source element and target element type.
93741
+ * The type is part of the key because the same source can be refracted into
93742
+ * different semantic elements depending on the referencing context (e.g. a
93743
+ * generic object referenced once as a Parameter and once as a Response).
93744
+ */
93745
+ refractCache;
93746
+
93747
+ /**
93748
+ * Canonical URIs of Path Item Objects currently being inlined. Path Items
93749
+ * are not hoisted into Components Object (no `components.pathItems` in
93750
+ * OpenAPI 3.0), so the `assignments` map can't break their cycles. This
93751
+ * stack guards against circular external Path Item references.
92107
93752
  */
92108
93753
  inlineStack;
92109
93754
  constructor({
@@ -92133,12 +93778,12 @@ class OpenAPI2BundleVisitor {
92133
93778
  byType.set(type, refracted);
92134
93779
  }
92135
93780
  toBaseURI(uri) {
92136
- return _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.resolve(this.reference.uri, _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.sanitize(_util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.stripHash(uri)));
93781
+ return _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.reference.uri, _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.sanitize(_util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.stripHash(uri)));
92137
93782
  }
92138
93783
  async toReference(uri) {
92139
93784
  // detect maximum depth of resolution
92140
93785
  if (this.reference.depth >= this.options.resolve.maxDepth) {
92141
- throw new _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_21__["default"](`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`, {
93786
+ throw new _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`, {
92142
93787
  maxDepth: this.options.resolve.maxDepth,
92143
93788
  uri: this.reference.uri
92144
93789
  });
@@ -92152,14 +93797,14 @@ class OpenAPI2BundleVisitor {
92152
93797
  if (refSet.has(baseURI)) {
92153
93798
  return refSet.find((0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(baseURI, 'uri'));
92154
93799
  }
92155
- const parseResult = await (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_23__["default"])(_util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.unsanitize(baseURI), {
93800
+ const parseResult = await (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_30__["default"])(_util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.unsanitize(baseURI), {
92156
93801
  ...this.options,
92157
93802
  parse: {
92158
93803
  ...this.options.parse,
92159
93804
  mediaType: 'text/plain'
92160
93805
  }
92161
93806
  });
92162
- const reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_24__["default"]({
93807
+ const reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_31__["default"]({
92163
93808
  uri: baseURI,
92164
93809
  value: parseResult,
92165
93810
  depth: this.reference.depth + 1
@@ -92169,12 +93814,12 @@ class OpenAPI2BundleVisitor {
92169
93814
  }
92170
93815
 
92171
93816
  /**
92172
- * Normalizes a self-file reference (e.g. `./root.json#/definitions/Pet`)
92173
- * to a bare fragment (`#/definitions/Pet`) so the bundled document stays
93817
+ * Normalizes a self-reference (e.g. `./root.json#/components/schemas/Pet`)
93818
+ * to a bare fragment (`#/components/schemas/Pet`) so the bundled document stays
92174
93819
  * transferable. Bare fragments are returned unchanged.
92175
93820
  */
92176
- normalizeSelfFileRef(ref) {
92177
- return ref.startsWith('#') ? ref : _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.getHash(ref);
93821
+ normalizeSelfReference(ref) {
93822
+ return ref.startsWith('#') ? ref : _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.getHash(ref);
92178
93823
  }
92179
93824
 
92180
93825
  /**
@@ -92193,13 +93838,13 @@ class OpenAPI2BundleVisitor {
92193
93838
  // breach (MaximumBundleDepthError, which also extends BundleError) is a
92194
93839
  // resolution failure and flows through below — wrapped and subject to
92195
93840
  // continueOnError, like dereferencing.
92196
- if (error instanceof _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_18__["default"] && !(error instanceof _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__["default"])) {
93841
+ if (error instanceof _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_25__["default"] && !(error instanceof _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"])) {
92197
93842
  throw error;
92198
93843
  }
92199
93844
  const {
92200
93845
  continueOnError
92201
93846
  } = this.options.bundle;
92202
- const isEntryDocument = _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
93847
+ const isEntryDocument = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
92203
93848
  const uri = this.reference.uri;
92204
93849
  const type = referencingElement.element;
92205
93850
  const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(referencingElement);
@@ -92213,12 +93858,12 @@ class OpenAPI2BundleVisitor {
92213
93858
  codeFrame
92214
93859
  };
92215
93860
  let unresolvedError;
92216
- if (error instanceof _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_19__["default"]) {
93861
+ if (error instanceof _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_26__["default"]) {
92217
93862
  // @ts-ignore
92218
93863
  error.trace = [hop, ...error.trace];
92219
93864
  unresolvedError = error;
92220
93865
  } else {
92221
- unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_19__["default"](message, {
93866
+ unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_26__["default"](message, {
92222
93867
  cause: error,
92223
93868
  type,
92224
93869
  uri,
@@ -92234,16 +93879,21 @@ class OpenAPI2BundleVisitor {
92234
93879
  }
92235
93880
 
92236
93881
  /**
92237
- * Lazily creates the requested top-level definition field on the entry
92238
- * document, returning the field where a fragment is hoisted.
93882
+ * Lazily creates the Components Object (and the requested field within it)
93883
+ * on the entry document, returning the field where a fragment is hoisted.
92239
93884
  */
92240
- ensureField(field) {
93885
+ ensureComponentsField(field) {
92241
93886
  const entryResult = this.entryResult;
92242
- let fieldElement = entryResult.get(field);
93887
+ let components = entryResult.components;
93888
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(components)) {
93889
+ components = new _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__["default"]();
93890
+ entryResult.components = components;
93891
+ }
93892
+ let fieldElement = components.get(field);
92243
93893
  if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(fieldElement)) {
92244
- const FieldElement = fieldElementByField[field] ?? _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"];
93894
+ const FieldElement = componentFieldElementByField[field] ?? _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"];
92245
93895
  fieldElement = new FieldElement();
92246
- entryResult.set(field, fieldElement);
93896
+ components.set(field, fieldElement);
92247
93897
  }
92248
93898
  return fieldElement;
92249
93899
  }
@@ -92253,17 +93903,9 @@ class OpenAPI2BundleVisitor {
92253
93903
  * falling back to the referenced file's basename.
92254
93904
  */
92255
93905
  basenameOf(jsonPointer, baseURI) {
92256
- const tokens = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.parse)(jsonPointer).tree;
92257
- let candidate = tokens.length > 0 ? tokens[tokens.length - 1] : '';
92258
- if (candidate === '') {
92259
- const lastSlash = baseURI.lastIndexOf('/');
92260
- const lastDot = baseURI.lastIndexOf('.');
92261
- const fileName = baseURI.slice(lastSlash + 1);
92262
- // strip the extension only when the last dot belongs to the file name
92263
- candidate = lastDot > lastSlash ? baseURI.slice(lastSlash + 1, lastDot) : fileName;
92264
- }
92265
- if (candidate === '') candidate = 'Schema';
92266
- return candidate;
93906
+ const tokens = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.parse)(jsonPointer).tree;
93907
+ const lastToken = tokens.length > 0 ? tokens[tokens.length - 1] : '';
93908
+ return lastToken || _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.getBasename(baseURI) || 'Schema';
92267
93909
  }
92268
93910
 
92269
93911
  /**
@@ -92272,7 +93914,7 @@ class OpenAPI2BundleVisitor {
92272
93914
  */
92273
93915
  baseName(element, field, jsonPointer, baseURI) {
92274
93916
  // strategy specific options take precedence over the top-level bundle options
92275
- const componentNamesStrategy = this.options.bundle.strategyOpts['openapi-2']?.componentNamesStrategy ?? this.options.bundle.componentNamesStrategy;
93917
+ const componentNamesStrategy = this.options.bundle.strategyOpts['openapi-3-0']?.componentNamesStrategy ?? this.options.bundle.componentNamesStrategy;
92276
93918
  if (typeof componentNamesStrategy === 'function') {
92277
93919
  const resolved = componentNamesStrategy({
92278
93920
  element,
@@ -92288,7 +93930,7 @@ class OpenAPI2BundleVisitor {
92288
93930
  if (componentNamesStrategy === 'title') {
92289
93931
  const title = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(element) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(element.get('title')) : undefined;
92290
93932
  if (typeof title === 'string' && title.trim() !== '') {
92291
- const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.sanitizeComponentName)((0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.toPascalCase)(title));
93933
+ const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_32__.sanitizeComponentName)((0,_util_mjs__WEBPACK_IMPORTED_MODULE_32__.toPascalCase)(title));
92292
93934
  if (name !== '') return name;
92293
93935
  }
92294
93936
  // fall back to basename when no usable title is present
@@ -92298,29 +93940,24 @@ class OpenAPI2BundleVisitor {
92298
93940
 
92299
93941
  /**
92300
93942
  * Computes a collision-free component name within the target field. A name is
92301
- * taken if it's already placed in the field or reserved by a component that
93943
+ * taken if it's already placed in components or reserved by a component that
92302
93944
  * is still being bundled (reserved before recursion).
92303
93945
  */
92304
93946
  uniqueName(candidate, field) {
92305
- const fieldElement = this.ensureField(field);
93947
+ const fieldElement = this.ensureComponentsField(field);
92306
93948
  const reserved = this.reservedNames.get(field) ?? new Set();
92307
- return (0,_util_mjs__WEBPACK_IMPORTED_MODULE_25__.uniqueName)(candidate, name => fieldElement.hasKey(name) || reserved.has(name));
93949
+ return (0,_util_mjs__WEBPACK_IMPORTED_MODULE_32__.uniqueName)(candidate, name => fieldElement.hasKey(name) || reserved.has(name));
92308
93950
  }
92309
-
92310
- /**
92311
- * Bundles a Reference Object (parameters/responses) or a JSON Reference
92312
- * Object (schemas). The two reference flavors differ only in their predicate
92313
- * and refraction helpers, so the shared logic is parameterized here.
92314
- */
92315
- async bundleReference(path, referencingElement, isSemanticReference, isReferenceLike, refractReferenceFn, label) {
93951
+ async ReferenceElement(path) {
93952
+ const referencingElement = path.node;
92316
93953
  const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
92317
93954
  const retrievalURI = this.toBaseURI($ref);
92318
93955
  const isInternalReference = this.entryURI === retrievalURI;
92319
93956
  const isExternalReference = !isInternalReference;
92320
93957
  if (isInternalReference) {
92321
- // normalize self-file references to a bare fragment so the bundled
93958
+ // normalize self-references to a bare fragment so the bundled
92322
93959
  // document stays transferable; bare fragments are left untouched
92323
- referencingElement.set('$ref', this.normalizeSelfFileRef($ref));
93960
+ referencingElement.set('$ref', this.normalizeSelfReference($ref));
92324
93961
  path.skip();
92325
93962
  return;
92326
93963
  }
@@ -92330,16 +93967,16 @@ class OpenAPI2BundleVisitor {
92330
93967
  path.skip();
92331
93968
  return;
92332
93969
  }
92333
- const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.resolve(retrievalURI, $ref);
92334
- const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.URIFragmentIdentifier.fromURIReference($refBaseURI);
93970
+ const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
93971
+ const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
92335
93972
 
92336
- // the target field depends on the referencing context, so it's part of the
93973
+ // the target bucket depends on the referencing context, so it's part of the
92337
93974
  // identity: the same external target referenced as e.g. both a parameter and
92338
- // a response must be hoisted into both fields. The refractor sets
92339
- // `referenced-element` for every Reference Object position; the `schema`
93975
+ // a response must be hoisted into both components fields. The refractor sets
93976
+ // `referenced-element` for every Reference Object position; the `schemas`
92340
93977
  // fallback is a defensive default for the (unexpected) untagged case.
92341
93978
  const referencedElementType = referencingElement.meta.get('referenced-element');
92342
- const field = fieldByReferencedElement[referencedElementType] ?? fieldByReferencedElement.schema;
93979
+ const field = componentFieldByReferencedElement[referencedElementType] ?? componentFieldByReferencedElement.schema;
92343
93980
  const canonicalKey = `${field}\t${retrievalURI}#${jsonPointer}`;
92344
93981
 
92345
93982
  // already hoisted (or being hoisted) — just rewrite the pointer.
@@ -92359,7 +93996,7 @@ class OpenAPI2BundleVisitor {
92359
93996
  try {
92360
93997
  // detect maximum depth of bundling
92361
93998
  if (this.reference.depth >= this.options.bundle.maxDepth) {
92362
- throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
93999
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
92363
94000
  maxDepth: this.options.bundle.maxDepth,
92364
94001
  uri: this.reference.uri
92365
94002
  });
@@ -92367,21 +94004,21 @@ class OpenAPI2BundleVisitor {
92367
94004
  const reference = await this.toReference($ref);
92368
94005
 
92369
94006
  // possibly non-semantic fragment
92370
- let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.evaluate)(reference.value.result, jsonPointer);
94007
+ let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
92371
94008
 
92372
94009
  // apply semantics to the fragment so nested references become Reference Objects
92373
- if (referencedElement.element !== referencedElementType && !isSemanticReference(referencedElement)) {
94010
+ if (referencedElement.element !== referencedElementType && !(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_14__.isReferenceElement)(referencedElement)) {
92374
94011
  const cached = this.getRefracted(referencedElement, referencedElementType);
92375
94012
  if (cached !== undefined) {
92376
94013
  referencedElement = cached;
92377
- } else if (isReferenceLike(referencedElement)) {
94014
+ } else if ((0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_15__.isReferenceLikeElement)(referencedElement)) {
92378
94015
  const sourceElement = referencedElement;
92379
- referencedElement = refractReferenceFn(referencedElement);
94016
+ referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.refractReference)(referencedElement);
92380
94017
  referencedElement.meta.set('referenced-element', referencedElementType);
92381
94018
  this.setRefracted(sourceElement, referencedElementType, referencedElement);
92382
94019
  } else {
92383
94020
  const sourceElement = referencedElement;
92384
- referencedElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__["default"])(referencedElement, {
94021
+ referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__["default"])(referencedElement, {
92385
94022
  element: referencedElementType
92386
94023
  });
92387
94024
  this.setRefracted(sourceElement, referencedElementType, referencedElement);
@@ -92389,16 +94026,16 @@ class OpenAPI2BundleVisitor {
92389
94026
  }
92390
94027
  const preferredName = this.baseName(referencedElement, field, jsonPointer, retrievalURI);
92391
94028
  const componentName = this.uniqueName(preferredName, field);
92392
- const internalPointer = `#/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.escape)(componentName)}`;
94029
+ const internalPointer = `#/components/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.escape)(componentName)}`;
92393
94030
 
92394
94031
  // a rename means two distinct targets resolved to the same name; each
92395
94032
  // keeps its own component (and origin), so report the rename per severity.
92396
94033
  // strategy specific options take precedence over the top-level bundle options
92397
- const onComponentNameCollision = this.options.bundle.strategyOpts['openapi-2']?.onComponentNameCollision ?? this.options.bundle.onComponentNameCollision;
94034
+ const onComponentNameCollision = this.options.bundle.strategyOpts['openapi-3-0']?.onComponentNameCollision ?? this.options.bundle.onComponentNameCollision;
92398
94035
  if (componentName !== preferredName && onComponentNameCollision !== 'off') {
92399
- const message = `Component "${preferredName}" in ${field} is referenced with the same name but different content. Renamed to "${componentName}".`;
94036
+ const message = `Component "${preferredName}" in components/${field} is referenced with the same name but different content. Renamed to "${componentName}".`;
92400
94037
  if (onComponentNameCollision === 'error') {
92401
- throw new _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_18__["default"](message);
94038
+ throw new _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_25__["default"](message);
92402
94039
  }
92403
94040
  const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](message);
92404
94041
  annotation.classes.push('warning');
@@ -92415,7 +94052,7 @@ class OpenAPI2BundleVisitor {
92415
94052
 
92416
94053
  // own a copy of the fragment and bundle its own external references
92417
94054
  const hoistedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
92418
- const visitor = new OpenAPI2BundleVisitor({
94055
+ const visitor = new OpenAPI3_0BundleVisitor({
92419
94056
  reference,
92420
94057
  options: this.options,
92421
94058
  assignments: this.assignments,
@@ -92423,7 +94060,7 @@ class OpenAPI2BundleVisitor {
92423
94060
  refractCache: this.refractCache,
92424
94061
  inlineStack: this.inlineStack
92425
94062
  });
92426
- const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverseAsync)(hoistedElement, visitor, {
94063
+ const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverseAsync)(hoistedElement, visitor, {
92427
94064
  mutable: true
92428
94065
  });
92429
94066
 
@@ -92432,38 +94069,23 @@ class OpenAPI2BundleVisitor {
92432
94069
  bundledElement.meta.set('ref-origin', reference.uri);
92433
94070
  }
92434
94071
 
92435
- // place the bundled fragment into the entry document's definitions
92436
- this.ensureField(field).set(componentName, bundledElement);
94072
+ // place the bundled fragment into the entry document's components
94073
+ this.ensureComponentsField(field).set(componentName, bundledElement);
92437
94074
 
92438
94075
  // rewrite the referencing element to point at the hoisted fragment
92439
94076
  referencingElement.set('$ref', internalPointer);
92440
94077
  path.skip();
92441
94078
  } catch (error) {
92442
- this.handleError(`Error while bundling ${label}. Cannot resolve $ref "${$ref}": ${error.message}`, error, referencingElement, '$ref', $ref, path);
94079
+ this.handleError(`Error while bundling Reference Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, referencingElement, '$ref', $ref, path);
92443
94080
  path.skip();
92444
94081
  }
92445
94082
  }
92446
94083
 
92447
94084
  /**
92448
- * Reference Object covers reusable Parameter and Response Objects, which are
92449
- * hoisted into the top-level `parameters` and `responses` fields.
92450
- */
92451
- async ReferenceElement(path) {
92452
- await this.bundleReference(path, path.node, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_15__.isReferenceElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_16__.isReferenceLikeElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__.refractReference, 'Reference Object');
92453
- }
92454
-
92455
- /**
92456
- * JSON Reference Object covers reusable Schema Objects, which are hoisted
92457
- * into the top-level `definitions` field.
92458
- */
92459
- async JSONReferenceElement(path) {
92460
- await this.bundleReference(path, path.node, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_12__.isJSONReferenceElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_14__.isJSONReferenceLikeElement, _speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_11__.refractJSONReference, 'JSON Reference Object');
92461
- }
92462
-
92463
- /**
92464
- * Path Item Object is not a top-level definition field in OpenAPI 2.0, so an
92465
- * external Path Item reference cannot be hoisted; it is inlined in place
92466
- * instead, after bundling its own external references.
94085
+ * Path Item Object is not a Components Object field in OpenAPI 3.0
94086
+ * (unlike 3.1 which has `components.pathItems`). An external Path Item
94087
+ * reference therefore cannot be hoisted; it is inlined in place instead,
94088
+ * after bundling its own external references.
92467
94089
  */
92468
94090
  async PathItemElement(path) {
92469
94091
  const pathItemElement = path.node;
@@ -92477,9 +94099,9 @@ class OpenAPI2BundleVisitor {
92477
94099
  const isInternalReference = this.entryURI === retrievalURI;
92478
94100
  const isExternalReference = !isInternalReference;
92479
94101
  if (isInternalReference) {
92480
- // normalize self-file references to a bare fragment so the bundled
94102
+ // normalize self-references to a bare fragment so the bundled
92481
94103
  // document stays transferable; bare fragments are left untouched
92482
- pathItemElement.set('$ref', this.normalizeSelfFileRef($ref));
94104
+ pathItemElement.set('$ref', this.normalizeSelfReference($ref));
92483
94105
  return;
92484
94106
  }
92485
94107
 
@@ -92487,8 +94109,8 @@ class OpenAPI2BundleVisitor {
92487
94109
  if (!this.options.resolve.external && isExternalReference) {
92488
94110
  return;
92489
94111
  }
92490
- const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_22__.resolve(retrievalURI, $ref);
92491
- const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.URIFragmentIdentifier.fromURIReference($refBaseURI);
94112
+ const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
94113
+ const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
92492
94114
  const canonicalKey = `${retrievalURI}#${jsonPointer}`;
92493
94115
 
92494
94116
  // a circular external Path Item reference cannot be inlined without
@@ -92499,22 +94121,22 @@ class OpenAPI2BundleVisitor {
92499
94121
  try {
92500
94122
  // detect maximum depth of bundling
92501
94123
  if (this.reference.depth >= this.options.bundle.maxDepth) {
92502
- throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_20__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
94124
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
92503
94125
  maxDepth: this.options.bundle.maxDepth,
92504
94126
  uri: this.reference.uri
92505
94127
  });
92506
94128
  }
92507
94129
  const reference = await this.toReference($ref);
92508
- let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_9__.evaluate)(reference.value.result, jsonPointer);
94130
+ let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
92509
94131
 
92510
94132
  // apply Path Item semantics to the referenced fragment
92511
- if (!(0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_15__.isPathItemElement)(referencedElement)) {
94133
+ if (!(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_14__.isPathItemElement)(referencedElement)) {
92512
94134
  const cached = this.getRefracted(referencedElement, 'pathItem');
92513
94135
  if (cached !== undefined) {
92514
94136
  referencedElement = cached;
92515
94137
  } else {
92516
94138
  const sourceElement = referencedElement;
92517
- referencedElement = (0,_speclynx_apidom_ns_openapi_2__WEBPACK_IMPORTED_MODULE_13__.refractPathItem)(referencedElement);
94139
+ referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.refractPathItem)(referencedElement);
92518
94140
  this.setRefracted(sourceElement, 'pathItem', referencedElement);
92519
94141
  }
92520
94142
  }
@@ -92522,7 +94144,7 @@ class OpenAPI2BundleVisitor {
92522
94144
  // own a copy and bundle the external references it contains
92523
94145
  const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
92524
94146
  this.inlineStack.add(canonicalKey);
92525
- const visitor = new OpenAPI2BundleVisitor({
94147
+ const visitor = new OpenAPI3_0BundleVisitor({
92526
94148
  reference,
92527
94149
  options: this.options,
92528
94150
  assignments: this.assignments,
@@ -92532,7 +94154,7 @@ class OpenAPI2BundleVisitor {
92532
94154
  });
92533
94155
  let bundledElement;
92534
94156
  try {
92535
- bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_8__.traverseAsync)(inlinedElement, visitor, {
94157
+ bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverseAsync)(inlinedElement, visitor, {
92536
94158
  mutable: true
92537
94159
  });
92538
94160
  } finally {
@@ -92555,28 +94177,115 @@ class OpenAPI2BundleVisitor {
92555
94177
  this.handleError(`Error while bundling Path Item Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, pathItemElement, '$ref', $ref, path);
92556
94178
  }
92557
94179
  }
94180
+
94181
+ /**
94182
+ * Example Object `externalValue` points at arbitrary external content that
94183
+ * has no place in the Components Object. The referenced value is inlined into
94184
+ * the Example's `value` field.
94185
+ */
94186
+ async ExampleElement(path) {
94187
+ const exampleElement = path.node;
94188
+
94189
+ // ignore Example Objects without an externalValue field
94190
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(exampleElement.externalValue)) {
94191
+ return;
94192
+ }
94193
+
94194
+ // value and externalValue fields are mutually exclusive
94195
+ if (exampleElement.hasKey('value') && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(exampleElement.externalValue)) {
94196
+ throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_8__["default"]('ExampleElement value and externalValue fields are mutually exclusive', {
94197
+ value: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(exampleElement.value),
94198
+ externalValue: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(exampleElement.externalValue)
94199
+ });
94200
+ }
94201
+ const externalValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(exampleElement.externalValue);
94202
+ const retrievalURI = this.toBaseURI(externalValue);
94203
+ const isInternalReference = this.entryURI === retrievalURI;
94204
+ const isExternalReference = !isInternalReference;
94205
+
94206
+ // honor the resolve.external switch
94207
+ if (!this.options.resolve.external && isExternalReference) {
94208
+ return;
94209
+ }
94210
+ try {
94211
+ const reference = await this.toReference(externalValue);
94212
+ const valueElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(reference.value.result);
94213
+ valueElement.meta.set('ref-origin', reference.uri);
94214
+ const exampleElementCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(exampleElement);
94215
+ exampleElementCopy.value = valueElement;
94216
+ exampleElementCopy.remove('externalValue');
94217
+ path.replaceWith(exampleElementCopy);
94218
+ } catch (error) {
94219
+ this.handleError(`Error while bundling Example Object. Cannot resolve externalValue "${externalValue}": ${error.message}`, error, exampleElement, 'externalValue', externalValue, path);
94220
+ }
94221
+ }
94222
+
94223
+ /**
94224
+ * Link Object `operationRef` points at an Operation Object, which has no
94225
+ * Components Object field in OpenAPI 3.0 and therefore cannot be hoisted or
94226
+ * inlined. To keep the link resolvable from the bundled document, an external
94227
+ * `operationRef` is rewritten to its absolute URI. Internal `operationRef`
94228
+ * values and `operationId` links are left untouched.
94229
+ */
94230
+ async LinkElement(path) {
94231
+ const linkElement = path.node;
94232
+
94233
+ // operationRef and operationId fields are mutually exclusive
94234
+ if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(linkElement.operationRef) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(linkElement.operationId)) {
94235
+ throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_8__["default"]('LinkElement operationRef and operationId fields are mutually exclusive', {
94236
+ operationRef: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(linkElement.operationRef),
94237
+ operationId: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(linkElement.operationId)
94238
+ });
94239
+ }
94240
+
94241
+ // only external operationRef links need adjusting
94242
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(linkElement.operationRef)) {
94243
+ return;
94244
+ }
94245
+ const operationRef = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(linkElement.operationRef);
94246
+ const retrievalURI = this.toBaseURI(operationRef);
94247
+ const isInternalReference = this.entryURI === retrievalURI;
94248
+ if (isInternalReference) {
94249
+ // normalize a self-reference operationRef to a bare fragment so the bundled
94250
+ // document stays transferable; bare fragments are left untouched
94251
+ linkElement.set('operationRef', this.normalizeSelfReference(operationRef));
94252
+ return;
94253
+ }
94254
+
94255
+ // honor the resolve.external switch
94256
+ if (!this.options.resolve.external) {
94257
+ return;
94258
+ }
94259
+
94260
+ // rewrite to an absolute URI so the link keeps resolving once the document
94261
+ // is treated as self-contained
94262
+ const absoluteURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.reference.uri, operationRef);
94263
+ if (absoluteURI !== operationRef) {
94264
+ linkElement.set('operationRef', absoluteURI);
94265
+ }
94266
+ }
92558
94267
  }
92559
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI2BundleVisitor);
94268
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI3_0BundleVisitor);
92560
94269
 
92561
94270
  /***/ },
92562
94271
 
92563
- /***/ 5138
94272
+ /***/ 58091
92564
94273
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
92565
94274
 
92566
94275
  "use strict";
92567
94276
  __webpack_require__.r(__webpack_exports__);
92568
94277
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
92569
- /* harmony export */ OpenAPI3_0BundleVisitor: () => (/* reexport safe */ _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
94278
+ /* harmony export */ OpenAPI3_1BundleVisitor: () => (/* reexport safe */ _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
92570
94279
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
92571
94280
  /* harmony export */ });
92572
94281
  /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12111);
92573
94282
  /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80796);
92574
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43151);
92575
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32131);
94283
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7822);
94284
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(76332);
92576
94285
  /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(82302);
92577
94286
  /* harmony import */ var _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88526);
92578
94287
  /* harmony import */ var _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(73723);
92579
- /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98968);
94288
+ /* harmony import */ var _visitor_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(34081);
92580
94289
 
92581
94290
 
92582
94291
 
@@ -92590,21 +94299,21 @@ __webpack_require__.r(__webpack_exports__);
92590
94299
  /**
92591
94300
  * @public
92592
94301
  */
92593
- class OpenAPI3_0BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
94302
+ class OpenAPI3_1BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_6__["default"] {
92594
94303
  constructor(options) {
92595
94304
  super({
92596
94305
  ...(options ?? {}),
92597
- name: 'openapi-3-0'
94306
+ name: 'openapi-3-1'
92598
94307
  });
92599
94308
  }
92600
94309
  canBundle(file) {
92601
94310
  // assert by media type
92602
94311
  if (file.mediaType !== 'text/plain') {
92603
- return _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
94312
+ return _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_2__["default"].includes(file.mediaType);
92604
94313
  }
92605
94314
 
92606
94315
  // assert by inspecting ApiDOM
92607
- return (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_3__.isOpenApi3_0Element)(file.parseResult?.result);
94316
+ return (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_3__.isOpenApi3_1Element)(file.parseResult?.result);
92608
94317
  }
92609
94318
  async bundle(file, options) {
92610
94319
  const immutableRefSet = options.bundle.refSet ?? new _ReferenceSet_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]();
@@ -92657,11 +94366,11 @@ class OpenAPI3_0BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MOD
92657
94366
  }
92658
94367
  }
92659
94368
 
92660
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI3_0BundleStrategy);
94369
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI3_1BundleStrategy);
92661
94370
 
92662
94371
  /***/ },
92663
94372
 
92664
- /***/ 98968
94373
+ /***/ 34081
92665
94374
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
92666
94375
 
92667
94376
  "use strict";
@@ -92669,39 +94378,51 @@ __webpack_require__.r(__webpack_exports__);
92669
94378
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
92670
94379
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
92671
94380
  /* harmony export */ });
92672
- /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6352);
92673
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25162);
92674
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12111);
92675
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97071);
92676
- /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84660);
92677
- /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(37205);
92678
- /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(44673);
92679
- /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16280);
92680
- /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44641);
92681
- /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(80796);
92682
- /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(12020);
92683
- /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(61198);
92684
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(30609);
92685
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(64708);
92686
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(32131);
92687
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21314);
92688
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29881);
92689
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(23806);
92690
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(23031);
92691
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(63842);
92692
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(87455);
92693
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(55122);
92694
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(71117);
92695
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(72257);
92696
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(69511);
92697
- /* harmony import */ var _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(89693);
92698
- /* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(34968);
92699
- /* harmony import */ var _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(55086);
92700
- /* harmony import */ var _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(10476);
92701
- /* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(18917);
92702
- /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(85533);
92703
- /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(82302);
92704
- /* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(78814);
94381
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87009);
94382
+ /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6352);
94383
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25162);
94384
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12111);
94385
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(97071);
94386
+ /* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84660);
94387
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37205);
94388
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(44673);
94389
+ /* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16280);
94390
+ /* harmony import */ var _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(44641);
94391
+ /* harmony import */ var _speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80796);
94392
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(12020);
94393
+ /* harmony import */ var _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(61198);
94394
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(21314);
94395
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(24329);
94396
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(29881);
94397
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(76332);
94398
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(23806);
94399
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(52645);
94400
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(23031);
94401
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(63842);
94402
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(87455);
94403
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(16363);
94404
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(55122);
94405
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(71117);
94406
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(72257);
94407
+ /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(69511);
94408
+ /* harmony import */ var _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(89693);
94409
+ /* harmony import */ var _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(34968);
94410
+ /* harmony import */ var _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(55086);
94411
+ /* harmony import */ var _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(10476);
94412
+ /* harmony import */ var _errors_EvaluationJsonSchemaUriError_mjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(22820);
94413
+ /* harmony import */ var _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(18917);
94414
+ /* harmony import */ var _parse_index_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(85533);
94415
+ /* harmony import */ var _Reference_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(82302);
94416
+ /* harmony import */ var _File_mjs__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(29217);
94417
+ /* harmony import */ var _dereference_strategies_openapi_3_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(10533);
94418
+ /* harmony import */ var _dereference_strategies_openapi_3_1_selectors_uri_mjs__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(92500);
94419
+ /* harmony import */ var _dereference_strategies_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(29587);
94420
+ /* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(78814);
94421
+
94422
+
94423
+
94424
+
94425
+
92705
94426
 
92706
94427
 
92707
94428
 
@@ -92723,7 +94444,7 @@ __webpack_require__.r(__webpack_exports__);
92723
94444
  * Field names are sourced from the Components Object fixed fields so they
92724
94445
  * cannot drift from the namespace definition.
92725
94446
  */
92726
- const cf = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_5__.fixedFields)(_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__["default"], {
94447
+ const cf = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__.fixedFields)(_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_18__.ComponentsElement, {
92727
94448
  indexed: true
92728
94449
  });
92729
94450
  const componentFieldByReferencedElement = {
@@ -92735,7 +94456,8 @@ const componentFieldByReferencedElement = {
92735
94456
  header: cf.headers.name,
92736
94457
  securityScheme: cf.securitySchemes.name,
92737
94458
  link: cf.links.name,
92738
- callback: cf.callbacks.name
94459
+ callback: cf.callbacks.name,
94460
+ pathItem: cf.pathItems.name
92739
94461
  };
92740
94462
 
92741
94463
  /**
@@ -92745,15 +94467,16 @@ const componentFieldByReferencedElement = {
92745
94467
  * object.
92746
94468
  */
92747
94469
  const componentFieldElementByField = {
92748
- [cf.schemas.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_23__["default"],
92749
- [cf.responses.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_22__["default"],
92750
- [cf.parameters.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_20__["default"],
92751
- [cf.examples.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_17__["default"],
92752
- [cf.requestBodies.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_21__["default"],
92753
- [cf.headers.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_18__["default"],
92754
- [cf.securitySchemes.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_24__["default"],
92755
- [cf.links.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_19__["default"],
92756
- [cf.callbacks.name]: _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_16__["default"]
94470
+ [cf.schemas.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_25__["default"],
94471
+ [cf.responses.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_24__["default"],
94472
+ [cf.parameters.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_21__["default"],
94473
+ [cf.examples.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_17__["default"],
94474
+ [cf.requestBodies.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_23__["default"],
94475
+ [cf.headers.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_19__["default"],
94476
+ [cf.securitySchemes.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_26__["default"],
94477
+ [cf.links.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_20__["default"],
94478
+ [cf.callbacks.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_15__["default"],
94479
+ [cf.pathItems.name]: _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_22__["default"]
92757
94480
  };
92758
94481
 
92759
94482
  /**
@@ -92763,7 +94486,7 @@ const componentFieldElementByField = {
92763
94486
  /**
92764
94487
  * @public
92765
94488
  */
92766
- class OpenAPI3_0BundleVisitor {
94489
+ class OpenAPI3_1BundleVisitor {
92767
94490
  reference;
92768
94491
  options;
92769
94492
 
@@ -92773,7 +94496,7 @@ class OpenAPI3_0BundleVisitor {
92773
94496
  * Derived from the shared refSet's root reference.
92774
94497
  */
92775
94498
  get entryURI() {
92776
- return _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.stripHash(this.reference.refSet?.rootRef?.uri ?? '');
94499
+ return _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(this.reference.refSet?.rootRef?.uri ?? '');
92777
94500
  }
92778
94501
 
92779
94502
  /**
@@ -92786,7 +94509,7 @@ class OpenAPI3_0BundleVisitor {
92786
94509
  /**
92787
94510
  * The entry document element. Hoisted external fragments are placed into its
92788
94511
  * `components` object. The `canBundle` guard guarantees it is an
92789
- * OpenApi3_0Element.
94512
+ * OpenApi3_1Element.
92790
94513
  */
92791
94514
  get entryResult() {
92792
94515
  return this.entryParseResult.result;
@@ -92813,25 +94536,15 @@ class OpenAPI3_0BundleVisitor {
92813
94536
  * generic object referenced once as a Parameter and once as a Response).
92814
94537
  */
92815
94538
  refractCache;
92816
-
92817
- /**
92818
- * Canonical URIs of Path Item Objects currently being inlined. Path Items
92819
- * are not hoisted into Components Object (no `components.pathItems` in
92820
- * OpenAPI 3.0), so the `assignments` map can't break their cycles. This
92821
- * stack guards against circular external Path Item references.
92822
- */
92823
- inlineStack;
92824
94539
  constructor({
92825
94540
  reference,
92826
94541
  options,
92827
94542
  assignments = new Map(),
92828
94543
  reservedNames = new Map(),
92829
- refractCache = new WeakMap(),
92830
- inlineStack = new Set()
94544
+ refractCache = new WeakMap()
92831
94545
  }) {
92832
94546
  this.reference = reference;
92833
94547
  this.options = options;
92834
- this.inlineStack = inlineStack;
92835
94548
  this.assignments = assignments;
92836
94549
  this.reservedNames = reservedNames;
92837
94550
  this.refractCache = refractCache;
@@ -92848,12 +94561,12 @@ class OpenAPI3_0BundleVisitor {
92848
94561
  byType.set(type, refracted);
92849
94562
  }
92850
94563
  toBaseURI(uri) {
92851
- return _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.reference.uri, _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.sanitize(_util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.stripHash(uri)));
94564
+ return _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.resolve(this.reference.uri, _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.sanitize(_util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(uri)));
92852
94565
  }
92853
94566
  async toReference(uri) {
92854
94567
  // detect maximum depth of resolution
92855
94568
  if (this.reference.depth >= this.options.resolve.maxDepth) {
92856
- throw new _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`, {
94569
+ throw new _errors_MaximumResolveDepthError_mjs__WEBPACK_IMPORTED_MODULE_30__["default"](`Maximum resolution depth of ${this.options.resolve.maxDepth} has been exceeded by file "${this.reference.uri}"`, {
92857
94570
  maxDepth: this.options.resolve.maxDepth,
92858
94571
  uri: this.reference.uri
92859
94572
  });
@@ -92865,16 +94578,16 @@ class OpenAPI3_0BundleVisitor {
92865
94578
 
92866
94579
  // we've already processed this Reference in past
92867
94580
  if (refSet.has(baseURI)) {
92868
- return refSet.find((0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(baseURI, 'uri'));
94581
+ return refSet.find((0,ramda__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURI, 'uri'));
92869
94582
  }
92870
- const parseResult = await (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_30__["default"])(_util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.unsanitize(baseURI), {
94583
+ const parseResult = await (0,_parse_index_mjs__WEBPACK_IMPORTED_MODULE_33__["default"])(_util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.unsanitize(baseURI), {
92871
94584
  ...this.options,
92872
94585
  parse: {
92873
94586
  ...this.options.parse,
92874
94587
  mediaType: 'text/plain'
92875
94588
  }
92876
94589
  });
92877
- const reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_31__["default"]({
94590
+ const reference = new _Reference_mjs__WEBPACK_IMPORTED_MODULE_34__["default"]({
92878
94591
  uri: baseURI,
92879
94592
  value: parseResult,
92880
94593
  depth: this.reference.depth + 1
@@ -92884,12 +94597,12 @@ class OpenAPI3_0BundleVisitor {
92884
94597
  }
92885
94598
 
92886
94599
  /**
92887
- * Normalizes a self-file reference (e.g. `./root.json#/components/schemas/Pet`)
94600
+ * Normalizes a self-reference (e.g. `./root.json#/components/schemas/Pet`)
92888
94601
  * to a bare fragment (`#/components/schemas/Pet`) so the bundled document stays
92889
94602
  * transferable. Bare fragments are returned unchanged.
92890
94603
  */
92891
- normalizeSelfFileRef(ref) {
92892
- return ref.startsWith('#') ? ref : _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.getHash(ref);
94604
+ normalizeSelfReference(ref) {
94605
+ return ref.startsWith('#') ? ref : _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.getHash(ref);
92893
94606
  }
92894
94607
 
92895
94608
  /**
@@ -92908,16 +94621,16 @@ class OpenAPI3_0BundleVisitor {
92908
94621
  // breach (MaximumBundleDepthError, which also extends BundleError) is a
92909
94622
  // resolution failure and flows through below — wrapped and subject to
92910
94623
  // continueOnError, like dereferencing.
92911
- if (error instanceof _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_25__["default"] && !(error instanceof _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"])) {
94624
+ if (error instanceof _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"] && !(error instanceof _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_29__["default"])) {
92912
94625
  throw error;
92913
94626
  }
92914
94627
  const {
92915
94628
  continueOnError
92916
94629
  } = this.options.bundle;
92917
- const isEntryDocument = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
94630
+ const isEntryDocument = _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(this.reference.refSet?.rootRef?.uri ?? '') === this.reference.uri;
92918
94631
  const uri = this.reference.uri;
92919
94632
  const type = referencingElement.element;
92920
- const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(referencingElement);
94633
+ const codeFrame = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_8__["default"])(referencingElement);
92921
94634
  const location = visitorPath.formatPath();
92922
94635
  const hop = {
92923
94636
  uri,
@@ -92928,12 +94641,12 @@ class OpenAPI3_0BundleVisitor {
92928
94641
  codeFrame
92929
94642
  };
92930
94643
  let unresolvedError;
92931
- if (error instanceof _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_26__["default"]) {
94644
+ if (error instanceof _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_28__["default"]) {
92932
94645
  // @ts-ignore
92933
94646
  error.trace = [hop, ...error.trace];
92934
94647
  unresolvedError = error;
92935
94648
  } else {
92936
- unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_26__["default"](message, {
94649
+ unresolvedError = new _errors_UnresolvableReferenceError_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](message, {
92937
94650
  cause: error,
92938
94651
  type,
92939
94652
  uri,
@@ -92955,13 +94668,13 @@ class OpenAPI3_0BundleVisitor {
92955
94668
  ensureComponentsField(field) {
92956
94669
  const entryResult = this.entryResult;
92957
94670
  let components = entryResult.components;
92958
- if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(components)) {
92959
- components = new _speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_12__["default"]();
94671
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isObjectElement)(components)) {
94672
+ components = new _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_18__.ComponentsElement();
92960
94673
  entryResult.components = components;
92961
94674
  }
92962
94675
  let fieldElement = components.get(field);
92963
- if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(fieldElement)) {
92964
- const FieldElement = componentFieldElementByField[field] ?? _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"];
94676
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isObjectElement)(fieldElement)) {
94677
+ const FieldElement = componentFieldElementByField[field] ?? _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"];
92965
94678
  fieldElement = new FieldElement();
92966
94679
  components.set(field, fieldElement);
92967
94680
  }
@@ -92973,17 +94686,9 @@ class OpenAPI3_0BundleVisitor {
92973
94686
  * falling back to the referenced file's basename.
92974
94687
  */
92975
94688
  basenameOf(jsonPointer, baseURI) {
92976
- const tokens = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.parse)(jsonPointer).tree;
92977
- let candidate = tokens.length > 0 ? tokens[tokens.length - 1] : '';
92978
- if (candidate === '') {
92979
- const lastSlash = baseURI.lastIndexOf('/');
92980
- const lastDot = baseURI.lastIndexOf('.');
92981
- const fileName = baseURI.slice(lastSlash + 1);
92982
- // strip the extension only when the last dot belongs to the file name
92983
- candidate = lastDot > lastSlash ? baseURI.slice(lastSlash + 1, lastDot) : fileName;
92984
- }
92985
- if (candidate === '') candidate = 'Schema';
92986
- return candidate;
94689
+ const tokens = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__.parse)(jsonPointer).tree;
94690
+ const lastToken = tokens.length > 0 ? tokens[tokens.length - 1] : '';
94691
+ return lastToken || _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.getBasename(baseURI) || 'Schema';
92987
94692
  }
92988
94693
 
92989
94694
  /**
@@ -92992,7 +94697,7 @@ class OpenAPI3_0BundleVisitor {
92992
94697
  */
92993
94698
  baseName(element, field, jsonPointer, baseURI) {
92994
94699
  // strategy specific options take precedence over the top-level bundle options
92995
- const componentNamesStrategy = this.options.bundle.strategyOpts['openapi-3-0']?.componentNamesStrategy ?? this.options.bundle.componentNamesStrategy;
94700
+ const componentNamesStrategy = this.options.bundle.strategyOpts['openapi-3-1']?.componentNamesStrategy ?? this.options.bundle.componentNamesStrategy;
92996
94701
  if (typeof componentNamesStrategy === 'function') {
92997
94702
  const resolved = componentNamesStrategy({
92998
94703
  element,
@@ -93006,9 +94711,9 @@ class OpenAPI3_0BundleVisitor {
93006
94711
  return this.basenameOf(jsonPointer, baseURI);
93007
94712
  }
93008
94713
  if (componentNamesStrategy === 'title') {
93009
- const title = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isObjectElement)(element) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(element.get('title')) : undefined;
94714
+ const title = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isObjectElement)(element) ? (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(element.get('title')) : undefined;
93010
94715
  if (typeof title === 'string' && title.trim() !== '') {
93011
- const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_32__.sanitizeComponentName)((0,_util_mjs__WEBPACK_IMPORTED_MODULE_32__.toPascalCase)(title));
94716
+ const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_39__.sanitizeComponentName)((0,_util_mjs__WEBPACK_IMPORTED_MODULE_39__.toPascalCase)(title));
93012
94717
  if (name !== '') return name;
93013
94718
  }
93014
94719
  // fall back to basename when no usable title is present
@@ -93024,18 +94729,40 @@ class OpenAPI3_0BundleVisitor {
93024
94729
  uniqueName(candidate, field) {
93025
94730
  const fieldElement = this.ensureComponentsField(field);
93026
94731
  const reserved = this.reservedNames.get(field) ?? new Set();
93027
- return (0,_util_mjs__WEBPACK_IMPORTED_MODULE_32__.uniqueName)(candidate, name => fieldElement.hasKey(name) || reserved.has(name));
94732
+ return (0,_util_mjs__WEBPACK_IMPORTED_MODULE_39__.uniqueName)(candidate, name => fieldElement.hasKey(name) || reserved.has(name));
94733
+ }
94734
+
94735
+ /**
94736
+ * Reports a collision-forced rename according to the configured severity.
94737
+ * A rename means two distinct targets resolved to the same name; each keeps
94738
+ * its own component (and origin), so report the rename per severity.
94739
+ */
94740
+ reportNameCollision(preferredName, componentName, field) {
94741
+ // strategy specific options take precedence over the top-level bundle options
94742
+ const onComponentNameCollision = this.options.bundle.strategyOpts['openapi-3-1']?.onComponentNameCollision ?? this.options.bundle.onComponentNameCollision;
94743
+ if (componentName === preferredName || onComponentNameCollision === 'off') {
94744
+ return;
94745
+ }
94746
+ const message = `Component "${preferredName}" in components/${field} is referenced with the same name but different content. Renamed to "${componentName}".`;
94747
+ if (onComponentNameCollision === 'error') {
94748
+ throw new _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](message);
94749
+ }
94750
+ const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"](message);
94751
+ annotation.classes.push('warning');
94752
+ annotation.code = 'bundle-component-name-collision';
94753
+ // append (never prepend) so the result element stays ahead of annotations
94754
+ this.entryParseResult.content.push(annotation);
93028
94755
  }
93029
94756
  async ReferenceElement(path) {
93030
94757
  const referencingElement = path.node;
93031
- const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(referencingElement.$ref);
94758
+ const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(referencingElement.$ref);
93032
94759
  const retrievalURI = this.toBaseURI($ref);
93033
94760
  const isInternalReference = this.entryURI === retrievalURI;
93034
94761
  const isExternalReference = !isInternalReference;
93035
94762
  if (isInternalReference) {
93036
- // normalize self-file references to a bare fragment so the bundled
94763
+ // normalize self-references to a bare fragment so the bundled
93037
94764
  // document stays transferable; bare fragments are left untouched
93038
- referencingElement.set('$ref', this.normalizeSelfFileRef($ref));
94765
+ referencingElement.set('$ref', this.normalizeSelfReference($ref));
93039
94766
  path.skip();
93040
94767
  return;
93041
94768
  }
@@ -93045,8 +94772,8 @@ class OpenAPI3_0BundleVisitor {
93045
94772
  path.skip();
93046
94773
  return;
93047
94774
  }
93048
- const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
93049
- const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
94775
+ const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.resolve(retrievalURI, $ref);
94776
+ const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__.URIFragmentIdentifier.fromURIReference($refBaseURI);
93050
94777
 
93051
94778
  // the target bucket depends on the referencing context, so it's part of the
93052
94779
  // identity: the same external target referenced as e.g. both a parameter and
@@ -93074,7 +94801,7 @@ class OpenAPI3_0BundleVisitor {
93074
94801
  try {
93075
94802
  // detect maximum depth of bundling
93076
94803
  if (this.reference.depth >= this.options.bundle.maxDepth) {
93077
- throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
94804
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_29__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
93078
94805
  maxDepth: this.options.bundle.maxDepth,
93079
94806
  uri: this.reference.uri
93080
94807
  });
@@ -93082,21 +94809,21 @@ class OpenAPI3_0BundleVisitor {
93082
94809
  const reference = await this.toReference($ref);
93083
94810
 
93084
94811
  // possibly non-semantic fragment
93085
- let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
94812
+ let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.evaluate)(reference.value.result, jsonPointer);
93086
94813
 
93087
94814
  // apply semantics to the fragment so nested references become Reference Objects
93088
- if (referencedElement.element !== referencedElementType && !(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_14__.isReferenceElement)(referencedElement)) {
94815
+ if (referencedElement.element !== referencedElementType && !(0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_16__.isReferenceElement)(referencedElement)) {
93089
94816
  const cached = this.getRefracted(referencedElement, referencedElementType);
93090
94817
  if (cached !== undefined) {
93091
94818
  referencedElement = cached;
93092
- } else if ((0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_15__.isReferenceLikeElement)(referencedElement)) {
94819
+ } else if ((0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_13__.isReferenceLikeElement)(referencedElement)) {
93093
94820
  const sourceElement = referencedElement;
93094
- referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.refractReference)(referencedElement);
94821
+ referencedElement = (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_14__.refractReference)(referencedElement);
93095
94822
  referencedElement.meta.set('referenced-element', referencedElementType);
93096
94823
  this.setRefracted(sourceElement, referencedElementType, referencedElement);
93097
94824
  } else {
93098
94825
  const sourceElement = referencedElement;
93099
- referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__["default"])(referencedElement, {
94826
+ referencedElement = (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_14__["default"])(referencedElement, {
93100
94827
  element: referencedElementType
93101
94828
  });
93102
94829
  this.setRefracted(sourceElement, referencedElementType, referencedElement);
@@ -93104,23 +94831,8 @@ class OpenAPI3_0BundleVisitor {
93104
94831
  }
93105
94832
  const preferredName = this.baseName(referencedElement, field, jsonPointer, retrievalURI);
93106
94833
  const componentName = this.uniqueName(preferredName, field);
93107
- const internalPointer = `#/components/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.escape)(componentName)}`;
93108
-
93109
- // a rename means two distinct targets resolved to the same name; each
93110
- // keeps its own component (and origin), so report the rename per severity.
93111
- // strategy specific options take precedence over the top-level bundle options
93112
- const onComponentNameCollision = this.options.bundle.strategyOpts['openapi-3-0']?.onComponentNameCollision ?? this.options.bundle.onComponentNameCollision;
93113
- if (componentName !== preferredName && onComponentNameCollision !== 'off') {
93114
- const message = `Component "${preferredName}" in components/${field} is referenced with the same name but different content. Renamed to "${componentName}".`;
93115
- if (onComponentNameCollision === 'error') {
93116
- throw new _errors_BundleError_mjs__WEBPACK_IMPORTED_MODULE_25__["default"](message);
93117
- }
93118
- const annotation = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"](message);
93119
- annotation.classes.push('warning');
93120
- annotation.code = 'bundle-component-name-collision';
93121
- // append (never prepend) so the result element stays ahead of annotations
93122
- this.entryParseResult.content.push(annotation);
93123
- }
94834
+ const internalPointer = `#/components/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__.escape)(componentName)}`;
94835
+ this.reportNameCollision(preferredName, componentName, field);
93124
94836
 
93125
94837
  // reserve the assignment and component name before recursing so cyclic
93126
94838
  // references terminate
@@ -93129,21 +94841,20 @@ class OpenAPI3_0BundleVisitor {
93129
94841
  this.reservedNames.get(field).add(componentName);
93130
94842
 
93131
94843
  // own a copy of the fragment and bundle its own external references
93132
- const hoistedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
93133
- const visitor = new OpenAPI3_0BundleVisitor({
94844
+ const hoistedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(referencedElement);
94845
+ const visitor = new OpenAPI3_1BundleVisitor({
93134
94846
  reference,
93135
94847
  options: this.options,
93136
94848
  assignments: this.assignments,
93137
94849
  reservedNames: this.reservedNames,
93138
- refractCache: this.refractCache,
93139
- inlineStack: this.inlineStack
94850
+ refractCache: this.refractCache
93140
94851
  });
93141
- const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverseAsync)(hoistedElement, visitor, {
94852
+ const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__.traverseAsync)(hoistedElement, visitor, {
93142
94853
  mutable: true
93143
94854
  });
93144
94855
 
93145
94856
  // annotate the hoisted fragment with info about its origin
93146
- if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isElement)(bundledElement)) {
94857
+ if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isElement)(bundledElement)) {
93147
94858
  bundledElement.meta.set('ref-origin', reference.uri);
93148
94859
  }
93149
94860
 
@@ -93160,99 +94871,265 @@ class OpenAPI3_0BundleVisitor {
93160
94871
  }
93161
94872
 
93162
94873
  /**
93163
- * Path Item Object is not a Components Object field in OpenAPI 3.0
93164
- * (unlike 3.1 which has `components.pathItems`). An external Path Item
93165
- * reference therefore cannot be hoisted; it is inlined in place instead,
93166
- * after bundling its own external references.
94874
+ * Unlike OpenAPI 3.0 (which has no `components.pathItems` field and therefore
94875
+ * inlines external Path Items in place), OpenAPI 3.1 hoists an external Path
94876
+ * Item Object into `components.pathItems` and rewrites the referencing `$ref`
94877
+ * to an internal pointer — mirroring how Reference Objects are bundled.
94878
+ * Sibling fields next to the `$ref` (e.g. `summary`, `description`) are kept
94879
+ * on the referencing element.
93167
94880
  */
93168
94881
  async PathItemElement(path) {
93169
94882
  const pathItemElement = path.node;
93170
94883
 
93171
94884
  // ignore Path Item Objects without a $ref field
93172
- if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(pathItemElement.$ref)) {
94885
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(pathItemElement.$ref)) {
93173
94886
  return;
93174
94887
  }
93175
- const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(pathItemElement.$ref);
94888
+ const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(pathItemElement.$ref);
93176
94889
  const retrievalURI = this.toBaseURI($ref);
93177
94890
  const isInternalReference = this.entryURI === retrievalURI;
93178
94891
  const isExternalReference = !isInternalReference;
93179
94892
  if (isInternalReference) {
93180
- // normalize self-file references to a bare fragment so the bundled
94893
+ // normalize self-references to a bare fragment so the bundled
93181
94894
  // document stays transferable; bare fragments are left untouched
93182
- pathItemElement.set('$ref', this.normalizeSelfFileRef($ref));
94895
+ pathItemElement.set('$ref', this.normalizeSelfReference($ref));
94896
+ path.skip();
93183
94897
  return;
93184
94898
  }
93185
94899
 
93186
94900
  // honor the resolve.external switch
93187
94901
  if (!this.options.resolve.external && isExternalReference) {
94902
+ path.skip();
93188
94903
  return;
93189
94904
  }
93190
- const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(retrievalURI, $ref);
93191
- const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.URIFragmentIdentifier.fromURIReference($refBaseURI);
93192
- const canonicalKey = `${retrievalURI}#${jsonPointer}`;
94905
+ const $refBaseURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.resolve(retrievalURI, $ref);
94906
+ const jsonPointer = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__.URIFragmentIdentifier.fromURIReference($refBaseURI);
94907
+ const field = cf.pathItems.name;
94908
+ const canonicalKey = `${field}\t${retrievalURI}#${jsonPointer}`;
93193
94909
 
93194
- // a circular external Path Item reference cannot be inlined without
93195
- // recursing forever; leave the $ref in place to break the cycle
93196
- if (this.inlineStack.has(canonicalKey)) {
94910
+ // already hoisted (or being hoisted) — just rewrite the pointer. The
94911
+ // assignment is reserved BEFORE recursing, so a circular Path Item chain
94912
+ // terminates here with an internal pointer instead of recursing forever.
94913
+ if (this.assignments.has(canonicalKey)) {
94914
+ pathItemElement.set('$ref', this.assignments.get(canonicalKey));
94915
+ path.skip();
93197
94916
  return;
93198
94917
  }
93199
94918
  try {
93200
94919
  // detect maximum depth of bundling
93201
94920
  if (this.reference.depth >= this.options.bundle.maxDepth) {
93202
- throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
94921
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_29__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
93203
94922
  maxDepth: this.options.bundle.maxDepth,
93204
94923
  uri: this.reference.uri
93205
94924
  });
93206
94925
  }
93207
94926
  const reference = await this.toReference($ref);
93208
- let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_10__.evaluate)(reference.value.result, jsonPointer);
94927
+ let referencedElement = (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.evaluate)(reference.value.result, jsonPointer);
93209
94928
 
93210
94929
  // apply Path Item semantics to the referenced fragment
93211
- if (!(0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_14__.isPathItemElement)(referencedElement)) {
94930
+ if (!(0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_16__.isPathItemElement)(referencedElement)) {
93212
94931
  const cached = this.getRefracted(referencedElement, 'pathItem');
93213
94932
  if (cached !== undefined) {
93214
94933
  referencedElement = cached;
93215
94934
  } else {
93216
94935
  const sourceElement = referencedElement;
93217
- referencedElement = (0,_speclynx_apidom_ns_openapi_3_0__WEBPACK_IMPORTED_MODULE_13__.refractPathItem)(referencedElement);
94936
+ referencedElement = (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_14__.refractPathItem)(referencedElement);
93218
94937
  this.setRefracted(sourceElement, 'pathItem', referencedElement);
93219
94938
  }
93220
94939
  }
94940
+ const preferredName = this.baseName(referencedElement, field, jsonPointer, retrievalURI);
94941
+ const componentName = this.uniqueName(preferredName, field);
94942
+ const internalPointer = `#/components/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__.escape)(componentName)}`;
94943
+ this.reportNameCollision(preferredName, componentName, field);
93221
94944
 
93222
- // own a copy and bundle the external references it contains
93223
- const inlinedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(referencedElement);
93224
- this.inlineStack.add(canonicalKey);
93225
- const visitor = new OpenAPI3_0BundleVisitor({
94945
+ // reserve the assignment and component name before recursing so cyclic
94946
+ // references terminate
94947
+ this.assignments.set(canonicalKey, internalPointer);
94948
+ if (!this.reservedNames.has(field)) this.reservedNames.set(field, new Set());
94949
+ this.reservedNames.get(field).add(componentName);
94950
+
94951
+ // own a copy of the fragment and bundle its own external references
94952
+ const hoistedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(referencedElement);
94953
+ const visitor = new OpenAPI3_1BundleVisitor({
93226
94954
  reference,
93227
94955
  options: this.options,
93228
94956
  assignments: this.assignments,
93229
94957
  reservedNames: this.reservedNames,
93230
- refractCache: this.refractCache,
93231
- inlineStack: this.inlineStack
94958
+ refractCache: this.refractCache
93232
94959
  });
93233
- let bundledElement;
93234
- try {
93235
- bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_9__.traverseAsync)(inlinedElement, visitor, {
93236
- mutable: true
94960
+ const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__.traverseAsync)(hoistedElement, visitor, {
94961
+ mutable: true
94962
+ });
94963
+
94964
+ // a `$ref` surviving on the hoisted Path Item means it pointed at another
94965
+ // Path Item (a chain or cycle); it has already been rewritten to an
94966
+ // internal `#/components/pathItems/...` pointer by the child traversal
94967
+ bundledElement.meta.set('ref-origin', reference.uri);
94968
+
94969
+ // place the bundled Path Item into the entry document's components
94970
+ this.ensureComponentsField(field).set(componentName, bundledElement);
94971
+
94972
+ // rewrite the referencing Path Item to point at the hoisted one, keeping
94973
+ // any sibling fields (e.g. summary, description) next to the $ref
94974
+ pathItemElement.set('$ref', internalPointer);
94975
+ path.skip();
94976
+ } catch (error) {
94977
+ this.handleError(`Error while bundling Path Item Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, pathItemElement, '$ref', $ref, path);
94978
+ path.skip();
94979
+ }
94980
+ }
94981
+
94982
+ /**
94983
+ * Schema Objects in OpenAPI 3.1 are a JSON Schema 2020-12 dialect, so they are
94984
+ * bundled per the JSON Schema Compound Document rules: the external schema
94985
+ * RESOURCE is embedded verbatim into `components.schemas` (carrying its `$id`),
94986
+ * and the referencing `$ref` is left UNCHANGED — it keeps resolving against the
94987
+ * embedded resource's `$id`. This mirrors the canonical hyperjump
94988
+ * `json-schema-bundle` behavior (the whole resource is embedded once, keyed by
94989
+ * its `$id`; references are not rewritten).
94990
+ */
94991
+ async SchemaElement(path) {
94992
+ const referencingElement = path.node;
94993
+
94994
+ // skip current referencing schema as $ref keyword was not defined
94995
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(referencingElement.$ref)) {
94996
+ return;
94997
+ }
94998
+ const $ref = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(referencingElement.$ref);
94999
+ try {
95000
+ // compute baseURI using rules around $id and $ref keywords. The current
95001
+ // document's URI is the retrieval URI — derive it directly (not via
95002
+ // toReference) so an internal $ref needs no resolution and never trips the
95003
+ // resolve.maxDepth guard, matching how ReferenceElement returns early.
95004
+ const retrievalURI = this.reference.uri;
95005
+ const $refBaseURI = (0,_dereference_strategies_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_38__.resolveSchema$refField)(retrievalURI, referencingElement);
95006
+ const $refBaseURIStrippedHash = _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash($refBaseURI);
95007
+ const file = new _File_mjs__WEBPACK_IMPORTED_MODULE_35__["default"]({
95008
+ uri: $refBaseURIStrippedHash
95009
+ });
95010
+ const isUnknownURI = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(r => r.canRead(file), this.options.resolve.resolvers);
95011
+ const isURL = !isUnknownURI;
95012
+ const isInternalReference = _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(this.reference.uri) === $refBaseURIStrippedHash;
95013
+ const isExternalReference = !isInternalReference;
95014
+
95015
+ // internal Schema Object $refs resolve against the in-document $id graph;
95016
+ // leaving them untouched keeps that resolution valid. Unlike Reference
95017
+ // Objects, a JSON Schema $ref is NOT normalized to a bare fragment.
95018
+ if (isInternalReference) {
95019
+ return;
95020
+ }
95021
+
95022
+ // honor the resolve.external switch
95023
+ if (!this.options.resolve.external && isExternalReference) {
95024
+ return;
95025
+ }
95026
+
95027
+ // detect maximum depth of bundling before fetching the external resource,
95028
+ // matching ReferenceElement/PathItemElement (which check before toReference)
95029
+ if (this.reference.depth >= this.options.bundle.maxDepth) {
95030
+ throw new _errors_MaximumBundleDepthError_mjs__WEBPACK_IMPORTED_MODULE_29__["default"](`Maximum bundle depth of "${this.options.bundle.maxDepth}" has been exceeded in file "${this.reference.uri}"`, {
95031
+ maxDepth: this.options.bundle.maxDepth,
95032
+ uri: this.reference.uri
93237
95033
  });
93238
- } finally {
93239
- this.inlineStack.delete(canonicalKey);
93240
95034
  }
93241
95035
 
93242
- // merge sibling fields from the referencing Path Item over the referenced
93243
- // one. The referencing `$ref` is being resolved away and is skipped; the
93244
- // referenced element keeps its own `$ref` if one survived (i.e. it was
93245
- // left in place to break a circular external Path Item chain).
93246
- pathItemElement.forEach((_value, keyElement, item) => {
93247
- const key = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(keyElement);
93248
- if (key === '$ref') return;
93249
- bundledElement.remove(key);
93250
- bundledElement.content.push(item);
95036
+ // locate the external schema resource the $ref targets, reusing the
95037
+ // dereference strategy's classification. First try to resolve the target
95038
+ // as a canonical URI / URL against the current document's $id graph; if
95039
+ // that fails, fall back to fetching the external document and resolving
95040
+ // the fragment there as a $anchor or JSON Pointer.
95041
+ let schemaReference = this.reference;
95042
+ try {
95043
+ const referenceAsSchema = (0,_dereference_strategies_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_38__.maybeRefractToSchemaElement)(schemaReference.value.result);
95044
+ (0,_dereference_strategies_openapi_3_1_selectors_uri_mjs__WEBPACK_IMPORTED_MODULE_37__.evaluate)($refBaseURI, referenceAsSchema);
95045
+ } catch (error) {
95046
+ if (isURL && error instanceof _errors_EvaluationJsonSchemaUriError_mjs__WEBPACK_IMPORTED_MODULE_31__["default"]) {
95047
+ if ((0,_dereference_strategies_openapi_3_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_36__.isAnchor)((0,_dereference_strategies_openapi_3_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_36__.uriToAnchor)($refBaseURI))) {
95048
+ schemaReference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.unsanitize($refBaseURI));
95049
+ const selector = (0,_dereference_strategies_openapi_3_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_36__.uriToAnchor)($refBaseURI);
95050
+ const referenceAsSchema = (0,_dereference_strategies_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_38__.maybeRefractToSchemaElement)(schemaReference.value.result);
95051
+ (0,_dereference_strategies_openapi_3_1_selectors_$anchor_mjs__WEBPACK_IMPORTED_MODULE_36__.evaluate)(selector, referenceAsSchema);
95052
+ } else {
95053
+ schemaReference = await this.toReference(_util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.unsanitize($refBaseURI));
95054
+ const selector = _speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__.URIFragmentIdentifier.fromURIReference($refBaseURI);
95055
+ const referenceAsSchema = (0,_dereference_strategies_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_38__.maybeRefractToSchemaElement)(schemaReference.value.result);
95056
+ (0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_11__.evaluate)(referenceAsSchema, selector);
95057
+ }
95058
+ } else {
95059
+ throw error;
95060
+ }
95061
+ }
95062
+
95063
+ // a $ref that resolves (by $id/$anchor/pointer) within the current document
95064
+ // is internal even when its URI form (e.g. a URN or absolute $id) is not a
95065
+ // bare fragment. Leave it untouched — it resolves against the in-document
95066
+ // $id graph, and embedding the current document into itself would be wrong.
95067
+ if (_util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(schemaReference.uri) === _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(this.reference.uri)) {
95068
+ return;
95069
+ }
95070
+
95071
+ // the resource to embed is the WHOLE external document (its root schema),
95072
+ // identified by its $id. A $ref into a fragment of the document embeds the
95073
+ // entire document resource once; the fragment keeps resolving against the
95074
+ // embedded $id.
95075
+ const resourceRoot = (0,_dereference_strategies_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_38__.maybeRefractToSchemaElement)(schemaReference.value.result);
95076
+ const resourceBaseURI = (0,_dereference_strategies_openapi_3_1_util_mjs__WEBPACK_IMPORTED_MODULE_38__.resolveSchema$idField)(_util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(schemaReference.uri), resourceRoot) ?? _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.stripHash(schemaReference.uri);
95077
+ const field = cf.schemas.name;
95078
+ const canonicalKey = `${field}\t${resourceBaseURI}`;
95079
+
95080
+ // resource already embedded (or being embedded) — leave the referencing
95081
+ // $ref untouched and stop. This also terminates circular external schema
95082
+ // references, since the assignment is reserved BEFORE recursion.
95083
+ if (this.assignments.has(canonicalKey)) {
95084
+ path.skip();
95085
+ return;
95086
+ }
95087
+
95088
+ // own a copy of the resource and ensure it carries a $id so the unchanged
95089
+ // $ref still resolves against it once embedded
95090
+ const embeddedElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneDeep)(resourceRoot);
95091
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(embeddedElement.$id)) {
95092
+ embeddedElement.set('$id', resourceBaseURI);
95093
+ }
95094
+
95095
+ // the embedded thing is the WHOLE resource (keyed by its $id), so its name
95096
+ // is derived from the resource URI, not the $ref fragment — passing a root
95097
+ // pointer makes baseName fall back to the resource basename
95098
+ const preferredName = this.baseName(embeddedElement, field, '', resourceBaseURI);
95099
+ const componentName = this.uniqueName(preferredName, field);
95100
+ this.reportNameCollision(preferredName, componentName, field);
95101
+
95102
+ // reserve the assignment and component name before recursing so circular
95103
+ // external schema references terminate
95104
+ this.assignments.set(canonicalKey, `#/components/${field}/${(0,_speclynx_apidom_json_pointer__WEBPACK_IMPORTED_MODULE_12__.escape)(componentName)}`);
95105
+ if (!this.reservedNames.has(field)) this.reservedNames.set(field, new Set());
95106
+ this.reservedNames.get(field).add(componentName);
95107
+
95108
+ // bundle external references contained within the embedded resource;
95109
+ // nested external resources land flat in the same components.schemas
95110
+ const visitor = new OpenAPI3_1BundleVisitor({
95111
+ reference: schemaReference,
95112
+ options: this.options,
95113
+ assignments: this.assignments,
95114
+ reservedNames: this.reservedNames,
95115
+ refractCache: this.refractCache
93251
95116
  });
93252
- bundledElement.meta.set('ref-origin', reference.uri);
93253
- path.replaceWith(bundledElement);
95117
+ const bundledElement = await (0,_speclynx_apidom_traverse__WEBPACK_IMPORTED_MODULE_10__.traverseAsync)(embeddedElement, visitor, {
95118
+ mutable: true
95119
+ });
95120
+
95121
+ // annotate the embedded resource with info about its origin
95122
+ bundledElement.meta.set('ref-origin', schemaReference.uri);
95123
+
95124
+ // place the embedded resource into the entry document's components
95125
+ this.ensureComponentsField(field).set(componentName, bundledElement);
95126
+
95127
+ // the referencing $ref is left UNCHANGED — it resolves against the
95128
+ // embedded resource's $id
95129
+ path.skip();
93254
95130
  } catch (error) {
93255
- this.handleError(`Error while bundling Path Item Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, pathItemElement, '$ref', $ref, path);
95131
+ this.handleError(`Error while bundling Schema Object. Cannot resolve $ref "${$ref}": ${error.message}`, error, referencingElement, '$ref', $ref, path);
95132
+ path.skip();
93256
95133
  }
93257
95134
  }
93258
95135
 
@@ -93265,18 +95142,18 @@ class OpenAPI3_0BundleVisitor {
93265
95142
  const exampleElement = path.node;
93266
95143
 
93267
95144
  // ignore Example Objects without an externalValue field
93268
- if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(exampleElement.externalValue)) {
95145
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(exampleElement.externalValue)) {
93269
95146
  return;
93270
95147
  }
93271
95148
 
93272
95149
  // value and externalValue fields are mutually exclusive
93273
- if (exampleElement.hasKey('value') && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(exampleElement.externalValue)) {
93274
- throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_8__["default"]('ExampleElement value and externalValue fields are mutually exclusive', {
93275
- value: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(exampleElement.value),
93276
- externalValue: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(exampleElement.externalValue)
95150
+ if (exampleElement.hasKey('value') && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(exampleElement.externalValue)) {
95151
+ throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_9__["default"]('ExampleElement value and externalValue fields are mutually exclusive', {
95152
+ value: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(exampleElement.value),
95153
+ externalValue: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(exampleElement.externalValue)
93277
95154
  });
93278
95155
  }
93279
- const externalValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(exampleElement.externalValue);
95156
+ const externalValue = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(exampleElement.externalValue);
93280
95157
  const retrievalURI = this.toBaseURI(externalValue);
93281
95158
  const isInternalReference = this.entryURI === retrievalURI;
93282
95159
  const isExternalReference = !isInternalReference;
@@ -93287,9 +95164,9 @@ class OpenAPI3_0BundleVisitor {
93287
95164
  }
93288
95165
  try {
93289
95166
  const reference = await this.toReference(externalValue);
93290
- const valueElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(reference.value.result);
95167
+ const valueElement = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneShallow)(reference.value.result);
93291
95168
  valueElement.meta.set('ref-origin', reference.uri);
93292
- const exampleElementCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.cloneShallow)(exampleElement);
95169
+ const exampleElementCopy = (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__.cloneShallow)(exampleElement);
93293
95170
  exampleElementCopy.value = valueElement;
93294
95171
  exampleElementCopy.remove('externalValue');
93295
95172
  path.replaceWith(exampleElementCopy);
@@ -93300,7 +95177,7 @@ class OpenAPI3_0BundleVisitor {
93300
95177
 
93301
95178
  /**
93302
95179
  * Link Object `operationRef` points at an Operation Object, which has no
93303
- * Components Object field in OpenAPI 3.0 and therefore cannot be hoisted or
95180
+ * Components Object field in OpenAPI 3.1 and therefore cannot be hoisted or
93304
95181
  * inlined. To keep the link resolvable from the bundled document, an external
93305
95182
  * `operationRef` is rewritten to its absolute URI. Internal `operationRef`
93306
95183
  * values and `operationId` links are left untouched.
@@ -93309,24 +95186,24 @@ class OpenAPI3_0BundleVisitor {
93309
95186
  const linkElement = path.node;
93310
95187
 
93311
95188
  // operationRef and operationId fields are mutually exclusive
93312
- if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(linkElement.operationRef) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(linkElement.operationId)) {
93313
- throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_8__["default"]('LinkElement operationRef and operationId fields are mutually exclusive', {
93314
- operationRef: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(linkElement.operationRef),
93315
- operationId: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(linkElement.operationId)
95189
+ if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(linkElement.operationRef) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(linkElement.operationId)) {
95190
+ throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_9__["default"]('LinkElement operationRef and operationId fields are mutually exclusive', {
95191
+ operationRef: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(linkElement.operationRef),
95192
+ operationId: (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(linkElement.operationId)
93316
95193
  });
93317
95194
  }
93318
95195
 
93319
95196
  // only external operationRef links need adjusting
93320
- if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isStringElement)(linkElement.operationRef)) {
95197
+ if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.isStringElement)(linkElement.operationRef)) {
93321
95198
  return;
93322
95199
  }
93323
- const operationRef = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_6__["default"])(linkElement.operationRef);
95200
+ const operationRef = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_7__["default"])(linkElement.operationRef);
93324
95201
  const retrievalURI = this.toBaseURI(operationRef);
93325
95202
  const isInternalReference = this.entryURI === retrievalURI;
93326
95203
  if (isInternalReference) {
93327
- // normalize self-file operationRef to a bare fragment so the bundled
95204
+ // normalize a self-reference operationRef to a bare fragment so the bundled
93328
95205
  // document stays transferable; bare fragments are left untouched
93329
- linkElement.set('operationRef', this.normalizeSelfFileRef(operationRef));
95206
+ linkElement.set('operationRef', this.normalizeSelfReference(operationRef));
93330
95207
  return;
93331
95208
  }
93332
95209
 
@@ -93337,56 +95214,13 @@ class OpenAPI3_0BundleVisitor {
93337
95214
 
93338
95215
  // rewrite to an absolute URI so the link keeps resolving once the document
93339
95216
  // is treated as self-contained
93340
- const absoluteURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_29__.resolve(this.reference.uri, operationRef);
95217
+ const absoluteURI = _util_url_mjs__WEBPACK_IMPORTED_MODULE_32__.resolve(this.reference.uri, operationRef);
93341
95218
  if (absoluteURI !== operationRef) {
93342
95219
  linkElement.set('operationRef', absoluteURI);
93343
95220
  }
93344
95221
  }
93345
95222
  }
93346
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI3_0BundleVisitor);
93347
-
93348
- /***/ },
93349
-
93350
- /***/ 58091
93351
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
93352
-
93353
- "use strict";
93354
- __webpack_require__.r(__webpack_exports__);
93355
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
93356
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
93357
- /* harmony export */ });
93358
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7822);
93359
- /* harmony import */ var _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76332);
93360
- /* harmony import */ var _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73723);
93361
-
93362
-
93363
- /**
93364
- * @public
93365
- */
93366
- /**
93367
- * @public
93368
- */
93369
- class OpenAPI3_1BundleStrategy extends _BundleStrategy_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] {
93370
- constructor(options) {
93371
- super({
93372
- ...(options ?? {}),
93373
- name: 'openapi-3-1'
93374
- });
93375
- }
93376
- canBundle(file) {
93377
- // assert by media type
93378
- if (file.mediaType !== 'text/plain') {
93379
- return _speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_0__["default"].includes(file.mediaType);
93380
- }
93381
-
93382
- // assert by inspecting ApiDOM
93383
- return (0,_speclynx_apidom_ns_openapi_3_1__WEBPACK_IMPORTED_MODULE_1__.isOpenApi3_1Element)(file.parseResult?.result);
93384
- }
93385
- async bundle(file) {
93386
- return file.parseResult;
93387
- }
93388
- }
93389
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI3_1BundleStrategy);
95223
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OpenAPI3_1BundleVisitor);
93390
95224
 
93391
95225
  /***/ },
93392
95226
 
@@ -93442,48 +95276,48 @@ const uniqueName = (candidate, isTaken) => {
93442
95276
  "use strict";
93443
95277
  __webpack_require__.r(__webpack_exports__);
93444
95278
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
93445
- /* harmony export */ BundleError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.BundleError),
93446
- /* harmony export */ BundleStrategy: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.BundleStrategy),
93447
- /* harmony export */ DereferenceAncestorLineage: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.DereferenceAncestorLineage),
93448
- /* harmony export */ DereferenceError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.DereferenceError),
93449
- /* harmony export */ DereferenceStrategy: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.DereferenceStrategy),
93450
- /* harmony export */ EvaluationElementIdError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.EvaluationElementIdError),
93451
- /* harmony export */ EvaluationJsonSchema$anchorError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.EvaluationJsonSchema$anchorError),
93452
- /* harmony export */ EvaluationJsonSchemaUriError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.EvaluationJsonSchemaUriError),
93453
- /* harmony export */ File: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.File),
93454
- /* harmony export */ HTTPResolver: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.HTTPResolver),
93455
- /* harmony export */ InvalidJsonSchema$anchorError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.InvalidJsonSchema$anchorError),
93456
- /* harmony export */ JsonSchema$anchorError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.JsonSchema$anchorError),
93457
- /* harmony export */ JsonSchemaURIError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.JsonSchemaURIError),
93458
- /* harmony export */ MaximumBundleDepthError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.MaximumBundleDepthError),
93459
- /* harmony export */ MaximumDereferenceDepthError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.MaximumDereferenceDepthError),
93460
- /* harmony export */ MaximumResolveDepthError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.MaximumResolveDepthError),
93461
- /* harmony export */ ParseError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.ParseError),
93462
- /* harmony export */ Parser: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.Parser),
93463
- /* harmony export */ ParserError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.ParserError),
93464
- /* harmony export */ PluginError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.PluginError),
93465
- /* harmony export */ Reference: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.Reference),
93466
- /* harmony export */ ReferenceSet: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.ReferenceSet),
93467
- /* harmony export */ ResolveError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.ResolveError),
93468
- /* harmony export */ ResolveStrategy: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.ResolveStrategy),
93469
- /* harmony export */ Resolver: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.Resolver),
93470
- /* harmony export */ ResolverError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.ResolverError),
93471
- /* harmony export */ UnmatchedBundleStrategyError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.UnmatchedBundleStrategyError),
93472
- /* harmony export */ UnmatchedDereferenceStrategyError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.UnmatchedDereferenceStrategyError),
93473
- /* harmony export */ UnmatchedParserError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.UnmatchedParserError),
93474
- /* harmony export */ UnmatchedResolveStrategyError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.UnmatchedResolveStrategyError),
93475
- /* harmony export */ UnmatchedResolverError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.UnmatchedResolverError),
93476
- /* harmony export */ UnresolvableReferenceError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.UnresolvableReferenceError),
93477
- /* harmony export */ bundle: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.bundle),
93478
- /* harmony export */ dereference: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.dereference),
93479
- /* harmony export */ dereferenceApiDOM: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.dereferenceApiDOM),
93480
- /* harmony export */ mergeOptions: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.mergeOptions),
93481
- /* harmony export */ options: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.options),
93482
- /* harmony export */ parse: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.parse),
93483
- /* harmony export */ readFile: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.readFile),
93484
- /* harmony export */ resolve: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.resolve),
93485
- /* harmony export */ resolveApiDOM: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.resolveApiDOM),
93486
- /* harmony export */ url: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_36__.url)
95279
+ /* harmony export */ BundleError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.BundleError),
95280
+ /* harmony export */ BundleStrategy: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.BundleStrategy),
95281
+ /* harmony export */ DereferenceAncestorLineage: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.DereferenceAncestorLineage),
95282
+ /* harmony export */ DereferenceError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.DereferenceError),
95283
+ /* harmony export */ DereferenceStrategy: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.DereferenceStrategy),
95284
+ /* harmony export */ EvaluationElementIdError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.EvaluationElementIdError),
95285
+ /* harmony export */ EvaluationJsonSchema$anchorError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.EvaluationJsonSchema$anchorError),
95286
+ /* harmony export */ EvaluationJsonSchemaUriError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.EvaluationJsonSchemaUriError),
95287
+ /* harmony export */ File: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.File),
95288
+ /* harmony export */ HTTPResolver: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.HTTPResolver),
95289
+ /* harmony export */ InvalidJsonSchema$anchorError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.InvalidJsonSchema$anchorError),
95290
+ /* harmony export */ JsonSchema$anchorError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.JsonSchema$anchorError),
95291
+ /* harmony export */ JsonSchemaURIError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.JsonSchemaURIError),
95292
+ /* harmony export */ MaximumBundleDepthError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.MaximumBundleDepthError),
95293
+ /* harmony export */ MaximumDereferenceDepthError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.MaximumDereferenceDepthError),
95294
+ /* harmony export */ MaximumResolveDepthError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.MaximumResolveDepthError),
95295
+ /* harmony export */ ParseError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.ParseError),
95296
+ /* harmony export */ Parser: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.Parser),
95297
+ /* harmony export */ ParserError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.ParserError),
95298
+ /* harmony export */ PluginError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.PluginError),
95299
+ /* harmony export */ Reference: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.Reference),
95300
+ /* harmony export */ ReferenceSet: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.ReferenceSet),
95301
+ /* harmony export */ ResolveError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.ResolveError),
95302
+ /* harmony export */ ResolveStrategy: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.ResolveStrategy),
95303
+ /* harmony export */ Resolver: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.Resolver),
95304
+ /* harmony export */ ResolverError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.ResolverError),
95305
+ /* harmony export */ UnmatchedBundleStrategyError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.UnmatchedBundleStrategyError),
95306
+ /* harmony export */ UnmatchedDereferenceStrategyError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.UnmatchedDereferenceStrategyError),
95307
+ /* harmony export */ UnmatchedParserError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.UnmatchedParserError),
95308
+ /* harmony export */ UnmatchedResolveStrategyError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.UnmatchedResolveStrategyError),
95309
+ /* harmony export */ UnmatchedResolverError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.UnmatchedResolverError),
95310
+ /* harmony export */ UnresolvableReferenceError: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.UnresolvableReferenceError),
95311
+ /* harmony export */ bundle: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.bundle),
95312
+ /* harmony export */ dereference: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.dereference),
95313
+ /* harmony export */ dereferenceApiDOM: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.dereferenceApiDOM),
95314
+ /* harmony export */ mergeOptions: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.mergeOptions),
95315
+ /* harmony export */ options: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.options),
95316
+ /* harmony export */ parse: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.parse),
95317
+ /* harmony export */ readFile: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.readFile),
95318
+ /* harmony export */ resolve: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.resolve),
95319
+ /* harmony export */ resolveApiDOM: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.resolveApiDOM),
95320
+ /* harmony export */ url: () => (/* reexport safe */ _index_mjs__WEBPACK_IMPORTED_MODULE_37__.url)
93487
95321
  /* harmony export */ });
93488
95322
  /* harmony import */ var _resolve_resolvers_file_index_node_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(79948);
93489
95323
  /* harmony import */ var _resolve_resolvers_http_axios_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(352);
@@ -93520,8 +95354,10 @@ __webpack_require__.r(__webpack_exports__);
93520
95354
  /* harmony import */ var _bundle_strategies_openapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(95416);
93521
95355
  /* harmony import */ var _bundle_strategies_openapi_3_0_index_mjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(5138);
93522
95356
  /* harmony import */ var _bundle_strategies_openapi_3_1_index_mjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(58091);
93523
- /* harmony import */ var _index_mjs__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(30306);
93524
- /* harmony import */ var _index_mjs__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(37013);
95357
+ /* harmony import */ var _bundle_strategies_arazzo_1_index_mjs__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(27302);
95358
+ /* harmony import */ var _index_mjs__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(30306);
95359
+ /* harmony import */ var _index_mjs__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(37013);
95360
+
93525
95361
 
93526
95362
 
93527
95363
 
@@ -93558,7 +95394,7 @@ __webpack_require__.r(__webpack_exports__);
93558
95394
 
93559
95395
 
93560
95396
 
93561
- _index_mjs__WEBPACK_IMPORTED_MODULE_35__["default"].parse.parsers = [new _parse_parsers_openapi_json_2_index_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
95397
+ _index_mjs__WEBPACK_IMPORTED_MODULE_36__["default"].parse.parsers = [new _parse_parsers_openapi_json_2_index_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
93562
95398
  allowEmpty: true,
93563
95399
  sourceMap: false
93564
95400
  }), new _parse_parsers_openapi_yaml_2_index_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]({
@@ -93606,14 +95442,14 @@ _index_mjs__WEBPACK_IMPORTED_MODULE_35__["default"].parse.parsers = [new _parse_
93606
95442
  }), new _parse_parsers_binary_index_node_mjs__WEBPACK_IMPORTED_MODULE_24__["default"]({
93607
95443
  allowEmpty: true
93608
95444
  })];
93609
- _index_mjs__WEBPACK_IMPORTED_MODULE_35__["default"].resolve.resolvers = [new _resolve_resolvers_file_index_node_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](), new _resolve_resolvers_http_axios_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]({
95445
+ _index_mjs__WEBPACK_IMPORTED_MODULE_36__["default"].resolve.resolvers = [new _resolve_resolvers_file_index_node_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](), new _resolve_resolvers_http_axios_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]({
93610
95446
  timeout: 5000,
93611
95447
  redirects: 5,
93612
95448
  withCredentials: false
93613
95449
  })];
93614
- _index_mjs__WEBPACK_IMPORTED_MODULE_35__["default"].resolve.strategies = [new _resolve_strategies_openapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](), new _resolve_strategies_openapi_3_0_index_mjs__WEBPACK_IMPORTED_MODULE_3__["default"](), new _resolve_strategies_openapi_3_1_index_mjs__WEBPACK_IMPORTED_MODULE_4__["default"](), new _resolve_strategies_asyncapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"](), new _resolve_strategies_arazzo_1_index_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](), new _resolve_strategies_overlay_1_index_mjs__WEBPACK_IMPORTED_MODULE_7__["default"](), new _resolve_strategies_apidom_index_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]()];
93615
- _index_mjs__WEBPACK_IMPORTED_MODULE_35__["default"].dereference.strategies = [new _dereference_strategies_openapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_26__["default"](), new _dereference_strategies_openapi_3_0_index_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](), new _dereference_strategies_openapi_3_1_index_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](), new _dereference_strategies_asyncapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_29__["default"](), new _dereference_strategies_arazzo_1_index_mjs__WEBPACK_IMPORTED_MODULE_30__["default"](), new _dereference_strategies_overlay_1_index_mjs__WEBPACK_IMPORTED_MODULE_31__["default"](), new _dereference_strategies_apidom_index_mjs__WEBPACK_IMPORTED_MODULE_25__["default"]()];
93616
- _index_mjs__WEBPACK_IMPORTED_MODULE_35__["default"].bundle.strategies = [new _bundle_strategies_openapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_32__["default"](), new _bundle_strategies_openapi_3_0_index_mjs__WEBPACK_IMPORTED_MODULE_33__["default"](), new _bundle_strategies_openapi_3_1_index_mjs__WEBPACK_IMPORTED_MODULE_34__["default"]()];
95450
+ _index_mjs__WEBPACK_IMPORTED_MODULE_36__["default"].resolve.strategies = [new _resolve_strategies_openapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](), new _resolve_strategies_openapi_3_0_index_mjs__WEBPACK_IMPORTED_MODULE_3__["default"](), new _resolve_strategies_openapi_3_1_index_mjs__WEBPACK_IMPORTED_MODULE_4__["default"](), new _resolve_strategies_asyncapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_5__["default"](), new _resolve_strategies_arazzo_1_index_mjs__WEBPACK_IMPORTED_MODULE_6__["default"](), new _resolve_strategies_overlay_1_index_mjs__WEBPACK_IMPORTED_MODULE_7__["default"](), new _resolve_strategies_apidom_index_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]()];
95451
+ _index_mjs__WEBPACK_IMPORTED_MODULE_36__["default"].dereference.strategies = [new _dereference_strategies_openapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_26__["default"](), new _dereference_strategies_openapi_3_0_index_mjs__WEBPACK_IMPORTED_MODULE_27__["default"](), new _dereference_strategies_openapi_3_1_index_mjs__WEBPACK_IMPORTED_MODULE_28__["default"](), new _dereference_strategies_asyncapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_29__["default"](), new _dereference_strategies_arazzo_1_index_mjs__WEBPACK_IMPORTED_MODULE_30__["default"](), new _dereference_strategies_overlay_1_index_mjs__WEBPACK_IMPORTED_MODULE_31__["default"](), new _dereference_strategies_apidom_index_mjs__WEBPACK_IMPORTED_MODULE_25__["default"]()];
95452
+ _index_mjs__WEBPACK_IMPORTED_MODULE_36__["default"].bundle.strategies = [new _bundle_strategies_openapi_2_index_mjs__WEBPACK_IMPORTED_MODULE_32__["default"](), new _bundle_strategies_openapi_3_0_index_mjs__WEBPACK_IMPORTED_MODULE_33__["default"](), new _bundle_strategies_openapi_3_1_index_mjs__WEBPACK_IMPORTED_MODULE_34__["default"](), new _bundle_strategies_arazzo_1_index_mjs__WEBPACK_IMPORTED_MODULE_35__["default"]()];
93617
95453
 
93618
95454
 
93619
95455
  /***/ },
@@ -102355,6 +104191,7 @@ __webpack_require__.r(__webpack_exports__);
102355
104191
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
102356
104192
  /* harmony export */ cwd: () => (/* binding */ cwd),
102357
104193
  /* harmony export */ fromFileSystemPath: () => (/* binding */ fromFileSystemPath),
104194
+ /* harmony export */ getBasename: () => (/* binding */ getBasename),
102358
104195
  /* harmony export */ getExtension: () => (/* binding */ getExtension),
102359
104196
  /* harmony export */ getHash: () => (/* binding */ getHash),
102360
104197
  /* harmony export */ getProtocol: () => (/* binding */ getProtocol),
@@ -102413,19 +104250,40 @@ const getProtocol = url => {
102413
104250
  */
102414
104251
  const hasProtocol = (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])(getProtocol, ramda_adjunct__WEBPACK_IMPORTED_MODULE_6__["default"]);
102415
104252
 
104253
+ /**
104254
+ * Returns the final path segment of the given URI (the part after the last
104255
+ * `/`). Inputs are URIs, whose path separator is `/` — filesystem paths are
104256
+ * forward-slashed by `sanitize` before reaching here.
104257
+ */
104258
+ const getFilename = uri => uri.slice(uri.lastIndexOf('/') + 1);
104259
+
102416
104260
  /**
102417
104261
  * Returns the lower-cased file extension of the given URL,
102418
104262
  * or an empty string if it has no extension.
102419
104263
  * @public
102420
104264
  */
102421
104265
  const getExtension = url => {
102422
- const lastDotPosition = url.lastIndexOf('.');
104266
+ const fileName = getFilename(url);
104267
+ const lastDotPosition = fileName.lastIndexOf('.');
102423
104268
  if (lastDotPosition >= 0) {
102424
- return url.substring(lastDotPosition).toLowerCase();
104269
+ return fileName.substring(lastDotPosition).toLowerCase();
102425
104270
  }
102426
104271
  return '';
102427
104272
  };
102428
104273
 
104274
+ /**
104275
+ * Returns the final path segment of the given URI with its file extension
104276
+ * removed (e.g. `./schemas/Pet.json` -> `Pet`). Returns the whole segment when
104277
+ * there is no extension, and the whole URI when there is no path segment
104278
+ * (e.g. a URN).
104279
+ * @public
104280
+ */
104281
+ const getBasename = uri => {
104282
+ const fileName = getFilename(uri);
104283
+ const extension = getExtension(uri);
104284
+ return extension === '' ? fileName : fileName.slice(0, -extension.length);
104285
+ };
104286
+
102429
104287
  /**
102430
104288
  * Determines whether the given path is a filesystem path.
102431
104289
  * This includes "file://" URLs.