Fixed incorrect usage of id field in sdk.variable and used key

This commit is contained in:
Vishal Shingala
2021-02-19 11:07:44 +05:30
parent f558e664fb
commit 8017a8a923
3 changed files with 13 additions and 13 deletions

View File

@@ -418,7 +418,7 @@ module.exports = {
_.forOwn(serverVariables, (value, key) => {
let description = this.getParameterDescription(value);
variables.push(new sdk.Variable({
id: key,
key: key,
value: value.default || '',
description: description
}));
@@ -426,7 +426,7 @@ module.exports = {
}
if (keyName) {
variables.push(new sdk.Variable({
id: keyName,
key: keyName,
value: serverUrl,
type: 'string'
}));
@@ -2128,7 +2128,7 @@ module.exports = {
convertedPathVar = _.get(this.convertParamsWithStyle(element, fakedData, PARAMETER_SOURCE.REQUEST,
components, schemaCache, options), '[0]', {});
variableStore[element.name] = _.assign(convertedPathVar, { id: element.name, type: 'collection' });
variableStore[element.name] = _.assign(convertedPathVar, { key: element.name, type: 'collection' });
}
});
// accounting for the overriding of the root level and path level servers object if present at the operation level
@@ -2159,7 +2159,7 @@ module.exports = {
sanitizeResult.collectionVars.forEach((element) => {
if (!variableStore[element.name]) {
variableStore[element.name] = {
id: element.name,
key: element.name,
value: element.value || '',
description: element.description,
type: 'collection'