diff options
Diffstat (limited to 'app/assets/javascripts/blob/openapi/index.js')
-rw-r--r-- | app/assets/javascripts/blob/openapi/index.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/blob/openapi/index.js b/app/assets/javascripts/blob/openapi/index.js index 94ae281cada..9c22d960bf5 100644 --- a/app/assets/javascripts/blob/openapi/index.js +++ b/app/assets/javascripts/blob/openapi/index.js @@ -5,6 +5,7 @@ import { relativePathToAbsolute, joinPaths, setUrlParams, + getParameterByName, } from '~/lib/utils/url_utility'; const SANDBOX_FRAME_PATH = '/-/sandbox/swagger'; @@ -12,10 +13,14 @@ const SANDBOX_FRAME_PATH = '/-/sandbox/swagger'; const getSandboxFrameSrc = () => { const path = joinPaths(gon.relative_url_root || '', SANDBOX_FRAME_PATH); const absoluteUrl = relativePathToAbsolute(path, getBaseURL()); + const displayOperationId = getParameterByName('displayOperationId'); + const params = { displayOperationId }; + if (window.gon?.relative_url_root) { - return setUrlParams({ relativeRootPath: window.gon.relative_url_root }, absoluteUrl); + params.relativeRootPath = window.gon.relative_url_root; } - return absoluteUrl; + + return setUrlParams(params, absoluteUrl); }; const createSandbox = () => { |