mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Check for type and format in the original param instead of checking for value after processing
This commit is contained in:
@@ -1701,6 +1701,7 @@ module.exports = {
|
||||
var contentObj, // content is required
|
||||
bodyData,
|
||||
param,
|
||||
originalParam,
|
||||
paramArray = [],
|
||||
updateOptions = {},
|
||||
reqBody = new sdk.RequestBody(),
|
||||
@@ -1832,8 +1833,14 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
// Set param type to 'file' for binary value
|
||||
if (value === '<binary>') {
|
||||
// Fetch the original param and if it is of type 'string' and format 'binary'
|
||||
// then set the type of FormParam to 'file'
|
||||
originalParam = _.get(contentObj[FORM_DATA], ['schema', 'properties', key]);
|
||||
|
||||
if (originalParam &&
|
||||
originalParam.type === 'string' &&
|
||||
originalParam.format === 'binary'
|
||||
) {
|
||||
param = new sdk.FormParam({
|
||||
key: key,
|
||||
value: '',
|
||||
|
||||
Reference in New Issue
Block a user