openapi-explorer 2.1.647 → 2.1.648
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.
@@ -496,7 +496,9 @@ export default class ApiRequest extends LitElement {
|
|
496
496
|
const requestBodyContainerEl = requestPanelEl.querySelector('.request-body-container');
|
497
497
|
let pathUrl = `${this.serverUrl.replace(/\/$/, '')}${this.path.replaceAll(' ', '')}`; // Generate URL using Path Params
|
498
498
|
|
499
|
+
const pathParameterMap = {};
|
499
500
|
pathParamEls.map(el => {
|
501
|
+
pathParameterMap[el.dataset.pname] = el.value;
|
500
502
|
pathUrl = pathUrl.replace(`{${el.dataset.pname}}`, encodeURIComponent(el.value) || '-');
|
501
503
|
}); // Handle relative serverUrls
|
502
504
|
|
@@ -511,15 +513,18 @@ export default class ApiRequest extends LitElement {
|
|
511
513
|
headers: new Headers()
|
512
514
|
}; // Query Params
|
513
515
|
|
516
|
+
const queryParameterMap = {};
|
514
517
|
queryParamEls.forEach(el => {
|
515
518
|
if (!el.dataset.array || el.dataset.array === 'false') {
|
516
519
|
if (el.value !== '') {
|
520
|
+
queryParameterMap[el.dataset.pname] = el.value;
|
517
521
|
fetchUrl.searchParams.append(el.dataset.pname, el.value);
|
518
522
|
}
|
519
523
|
} else {
|
520
524
|
const paramSerializeStyle = el.dataset.paramSerializeStyle;
|
521
525
|
const paramSerializeExplode = el.dataset.paramSerializeExplode;
|
522
526
|
const values = Array.isArray(el.value) ? el.value.filter(v => v !== '') : [];
|
527
|
+
queryParameterMap[el.dataset.pname] = values;
|
523
528
|
|
524
529
|
if (values.length > 0) {
|
525
530
|
if (paramSerializeStyle === 'spaceDelimited') {
|
@@ -727,6 +732,8 @@ export default class ApiRequest extends LitElement {
|
|
727
732
|
return {
|
728
733
|
fetchOptions,
|
729
734
|
fetchUrl,
|
735
|
+
path: pathParameterMap,
|
736
|
+
query: queryParameterMap,
|
730
737
|
curlParts: {
|
731
738
|
data: curlData,
|
732
739
|
form: curlForm
|
@@ -752,7 +759,9 @@ export default class ApiRequest extends LitElement {
|
|
752
759
|
const tryBtnEl = this.querySelectorAll('.btn-execute')[0];
|
753
760
|
const {
|
754
761
|
fetchOptions,
|
755
|
-
fetchUrl
|
762
|
+
fetchUrl,
|
763
|
+
path,
|
764
|
+
query
|
756
765
|
} = this.recomputeFetchOptions();
|
757
766
|
this.responseIsBlob = false;
|
758
767
|
this.respContentDisposition = '';
|
@@ -766,6 +775,8 @@ export default class ApiRequest extends LitElement {
|
|
766
775
|
const fetchRequest = {
|
767
776
|
explorerLocation: this.elementId,
|
768
777
|
url: fetchUrl.toString(),
|
778
|
+
path,
|
779
|
+
query,
|
769
780
|
options: fetchOptions,
|
770
781
|
...fetchOptions
|
771
782
|
};
|
@@ -516,7 +516,9 @@ class ApiRequest extends _lit.LitElement {
|
|
516
516
|
const requestBodyContainerEl = requestPanelEl.querySelector('.request-body-container');
|
517
517
|
let pathUrl = `${this.serverUrl.replace(/\/$/, '')}${this.path.replaceAll(' ', '')}`; // Generate URL using Path Params
|
518
518
|
|
519
|
+
const pathParameterMap = {};
|
519
520
|
pathParamEls.map(el => {
|
521
|
+
pathParameterMap[el.dataset.pname] = el.value;
|
520
522
|
pathUrl = pathUrl.replace(`{${el.dataset.pname}}`, encodeURIComponent(el.value) || '-');
|
521
523
|
}); // Handle relative serverUrls
|
522
524
|
|
@@ -531,15 +533,18 @@ class ApiRequest extends _lit.LitElement {
|
|
531
533
|
headers: new Headers()
|
532
534
|
}; // Query Params
|
533
535
|
|
536
|
+
const queryParameterMap = {};
|
534
537
|
queryParamEls.forEach(el => {
|
535
538
|
if (!el.dataset.array || el.dataset.array === 'false') {
|
536
539
|
if (el.value !== '') {
|
540
|
+
queryParameterMap[el.dataset.pname] = el.value;
|
537
541
|
fetchUrl.searchParams.append(el.dataset.pname, el.value);
|
538
542
|
}
|
539
543
|
} else {
|
540
544
|
const paramSerializeStyle = el.dataset.paramSerializeStyle;
|
541
545
|
const paramSerializeExplode = el.dataset.paramSerializeExplode;
|
542
546
|
const values = Array.isArray(el.value) ? el.value.filter(v => v !== '') : [];
|
547
|
+
queryParameterMap[el.dataset.pname] = values;
|
543
548
|
|
544
549
|
if (values.length > 0) {
|
545
550
|
if (paramSerializeStyle === 'spaceDelimited') {
|
@@ -747,6 +752,8 @@ class ApiRequest extends _lit.LitElement {
|
|
747
752
|
return {
|
748
753
|
fetchOptions,
|
749
754
|
fetchUrl,
|
755
|
+
path: pathParameterMap,
|
756
|
+
query: queryParameterMap,
|
750
757
|
curlParts: {
|
751
758
|
data: curlData,
|
752
759
|
form: curlForm
|
@@ -772,7 +779,9 @@ class ApiRequest extends _lit.LitElement {
|
|
772
779
|
const tryBtnEl = this.querySelectorAll('.btn-execute')[0];
|
773
780
|
const {
|
774
781
|
fetchOptions,
|
775
|
-
fetchUrl
|
782
|
+
fetchUrl,
|
783
|
+
path,
|
784
|
+
query
|
776
785
|
} = this.recomputeFetchOptions();
|
777
786
|
this.responseIsBlob = false;
|
778
787
|
this.respContentDisposition = '';
|
@@ -786,6 +795,8 @@ class ApiRequest extends _lit.LitElement {
|
|
786
795
|
const fetchRequest = {
|
787
796
|
explorerLocation: this.elementId,
|
788
797
|
url: fetchUrl.toString(),
|
798
|
+
path,
|
799
|
+
query,
|
789
800
|
options: fetchOptions,
|
790
801
|
...fetchOptions
|
791
802
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "openapi-explorer",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.648",
|
4
4
|
"description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
|
5
5
|
"author": "Authress Developers <developers@authress.io>",
|
6
6
|
"type": "module",
|