mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Use 'file' mode if request schema type is 'string' and format is 'binary'
This commit is contained in:
@@ -1873,13 +1873,25 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
bodyData = this.convertToPmBodyData(contentObj[bodyType], requestType, bodyType,
|
||||
PARAMETER_SOURCE.REQUEST, options.indentCharacter, components, options, schemaCache);
|
||||
if (
|
||||
bodyType &&
|
||||
contentObj[bodyType].hasOwnProperty('schema') &&
|
||||
contentObj[bodyType]['schema'].type === 'string' &&
|
||||
contentObj[bodyType]['schema'].format === 'binary'
|
||||
) {
|
||||
updateOptions = {
|
||||
mode: 'file'
|
||||
};
|
||||
}
|
||||
else {
|
||||
bodyData = this.convertToPmBodyData(contentObj[bodyType], requestType, bodyType,
|
||||
PARAMETER_SOURCE.REQUEST, options.indentCharacter, components, options, schemaCache);
|
||||
|
||||
updateOptions = {
|
||||
mode: rDataMode,
|
||||
raw: JSON.stringify(bodyData, null, 4)
|
||||
};
|
||||
updateOptions = {
|
||||
mode: rDataMode,
|
||||
raw: JSON.stringify(bodyData, null, 4)
|
||||
};
|
||||
}
|
||||
|
||||
contentHeader = new sdk.Header({
|
||||
key: 'Content-Type',
|
||||
|
||||
Reference in New Issue
Block a user