API Explorer Query Params (#18743)

* adds query params to api explorer test requests

* adds changelog entry
This commit is contained in:
Jordan Reimer 2023-01-17 16:37:07 -07:00 committed by GitHub
parent 0f1a82b377
commit f58074a429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

3
changelog/18743.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
ui: fixes query parameters not passed in api explorer test requests
```

View File

@ -54,10 +54,10 @@ const CONFIG = (SwaggerUIBundle, componentInstance, initialFilter) => {
// we want to link to the right JSON in swagger UI so // we want to link to the right JSON in swagger UI so
// it's already been pre-pended // it's already been pre-pended
if (!req.loadSpec) { if (!req.loadSpec) {
const { protocol, host, pathname } = parseURL(req.url); const { protocol, host, pathname, search } = parseURL(req.url);
//paths in the spec don't have /v1 in them, so we need to add that here //paths in the spec don't have /v1 in them, so we need to add that here
// http(s): vlt.io:4200 /sys/mounts // http(s): vlt.io:4200 /sys/mounts
req.url = `${protocol}//${host}/v1${pathname}`; req.url = `${protocol}//${host}/v1${pathname}${search}`;
} }
return req; return req;
}, },