From f58074a4290db6993fb8aec6336f1c57792a32e6 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 17 Jan 2023 16:37:07 -0700 Subject: [PATCH] API Explorer Query Params (#18743) * adds query params to api explorer test requests * adds changelog entry --- changelog/18743.txt | 3 +++ ui/lib/open-api-explorer/addon/components/swagger-ui.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/18743.txt diff --git a/changelog/18743.txt b/changelog/18743.txt new file mode 100644 index 000000000..7cdfb79a5 --- /dev/null +++ b/changelog/18743.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: fixes query parameters not passed in api explorer test requests +``` \ No newline at end of file diff --git a/ui/lib/open-api-explorer/addon/components/swagger-ui.js b/ui/lib/open-api-explorer/addon/components/swagger-ui.js index 47567627f..69e579fa6 100644 --- a/ui/lib/open-api-explorer/addon/components/swagger-ui.js +++ b/ui/lib/open-api-explorer/addon/components/swagger-ui.js @@ -54,10 +54,10 @@ const CONFIG = (SwaggerUIBundle, componentInstance, initialFilter) => { // we want to link to the right JSON in swagger UI so // it's already been pre-pended 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 // http(s): vlt.io:4200 /sys/mounts - req.url = `${protocol}//${host}/v1${pathname}`; + req.url = `${protocol}//${host}/v1${pathname}${search}`; } return req; },