mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user