Skip to content

Commit bb57fd2

Browse files
committed
Send server variables to Client as JS objects
1 parent 6f5649c commit bb57fd2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/plugins/spec/actions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ export const executeRequest = (req) =>
232232

233233
req.server = oas3Selectors.selectedServer(namespace) || oas3Selectors.selectedServer()
234234

235-
const operationVariables = oas3Selectors.serverVariables({
235+
const namespaceVariables = oas3Selectors.serverVariables({
236236
server: req.server,
237237
namespace
238-
})
239-
const globalVariables = oas3Selectors.serverVariables({ server: req.server })
240-
241-
req.serverVariables = operationVariables.size ? operationVariables : globalVariables
238+
}).toJS()
239+
const globalVariables = oas3Selectors.serverVariables({ server: req.server }).toJS()
240+
241+
req.serverVariables = Object.keys(namespaceVariables).length ? namespaceVariables : globalVariables
242242

243243
req.requestContentType = oas3Selectors.requestContentType(pathName, method)
244244
req.responseContentType = oas3Selectors.responseContentType(pathName, method) || "*/*"

0 commit comments

Comments
 (0)