mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Fixed issue where collection variable generated for path variables contained empty values
This commit is contained in:
@@ -1906,12 +1906,14 @@ module.exports = {
|
||||
// Add collection variables to the variableStore.
|
||||
sanitizeResult.collectionVars.forEach((element) => {
|
||||
if (!variableStore[element.name]) {
|
||||
variableStore[element.name] = {
|
||||
id: element.name,
|
||||
value: element.default || '',
|
||||
description: element.description,
|
||||
type: 'collection'
|
||||
};
|
||||
let fakedData = options.schemaFaker ?
|
||||
safeSchemaFaker(element.schema || {}, options.requestParametersResolution, PROCESSING_TYPE.CONVERSION,
|
||||
PARAMETER_SOURCE.REQUEST, components, SCHEMA_FORMATS.DEFAULT, options.indentCharacter, schemaCache,
|
||||
options.stackLimit) : '',
|
||||
convertedPathVar = _.get(this.convertParamsWithStyle(element, fakedData, PARAMETER_SOURCE.REQUEST,
|
||||
components, schemaCache), '[0]', {});
|
||||
|
||||
variableStore[element.name] = _.assign(convertedPathVar, { id: element.name, type: 'collection' });
|
||||
}
|
||||
});
|
||||
// accounting for the overriding of the root level and path level servers object if present at the operation level
|
||||
@@ -3859,7 +3861,7 @@ module.exports = {
|
||||
// Not adding colloection variables for now
|
||||
suggestedValue: {
|
||||
request: convertedRequest,
|
||||
variables
|
||||
variables: _.values(variables)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user