Merge pull request #414 from postmanlabs/feature/fix-example-request-body-content-type

Fix issue where json and xml lanugages were not detected from the example request body content type
This commit is contained in:
Vishal Shingala
2021-10-11 12:35:41 +05:30
committed by GitHub
2 changed files with 197 additions and 1 deletions

View File

@@ -1854,7 +1854,7 @@ module.exports = {
}
else {
rDataMode = 'raw';
let bodyType;
let bodyType, language;
// checking for all possible raw types
if (contentObj.hasOwnProperty(APP_JS)) { bodyType = APP_JS; }
@@ -1893,6 +1893,16 @@ module.exports = {
};
}
language = this.getHeaderFamily(bodyType);
if (language !== HEADER_TYPE.INVALID) {
updateOptions.options = {
raw: {
language
}
};
}
contentHeader = new sdk.Header({
key: 'Content-Type',
value: bodyType