swagger-client 3.23.0 → 3.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4262,14 +4262,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4262
4262
|
/* harmony import */ var _http_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28288);
|
|
4263
4263
|
|
|
4264
4264
|
const retrievalURI = options => {
|
|
4265
|
+
/**
|
|
4266
|
+
* Swagger-UI uses baseDoc instead of url, this helper function exists
|
|
4267
|
+
* to allow both.
|
|
4268
|
+
*
|
|
4269
|
+
* In browser environment, we allow to pass a relative URI Reference,
|
|
4270
|
+
* and we resolve it against the document's baseURI before passing it deeper
|
|
4271
|
+
* to swagger-client code.
|
|
4272
|
+
*/
|
|
4265
4273
|
const {
|
|
4266
4274
|
baseDoc,
|
|
4267
4275
|
url
|
|
4268
4276
|
} = options;
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
// need to fix and pick one.
|
|
4272
|
-
return baseDoc || url || '';
|
|
4277
|
+
const retrievalURL = baseDoc ?? url ?? '';
|
|
4278
|
+
return typeof globalThis.document?.baseURI === 'string' ? String(new URL(retrievalURL, globalThis.document.baseURI)) : retrievalURL;
|
|
4273
4279
|
};
|
|
4274
4280
|
const httpClient = options => {
|
|
4275
4281
|
const {
|