Use 'file' mode if request schema type is 'string' and format is 'binary'

This commit is contained in:
Ankit Saini
2021-09-30 09:52:24 +05:30
parent c3647394fd
commit c3382897ea

View File

@@ -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',