mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Handling missing body properties
This commit is contained in:
@@ -280,7 +280,7 @@ module.exports = {
|
||||
// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject
|
||||
getPathMethods = function(pathKeys) {
|
||||
var methods = [];
|
||||
pathKeys.forEach(function(element) {
|
||||
pathKeys && pathKeys.forEach(function(element) {
|
||||
if (METHODS.includes(element)) {
|
||||
methods.push(element);
|
||||
}
|
||||
@@ -321,8 +321,6 @@ module.exports = {
|
||||
currentNode.addChildren(currentPath[i], new Node({
|
||||
name: currentPath[i],
|
||||
requestCount: 0,
|
||||
requests: [],
|
||||
children: {},
|
||||
type: 'item-group'
|
||||
}));
|
||||
}
|
||||
@@ -1012,7 +1010,7 @@ module.exports = {
|
||||
type: typeof value
|
||||
};
|
||||
params = this.convertParamsWithStyle(encoding[key], value);
|
||||
params.forEach((element) => {
|
||||
params && params.forEach((element) => {
|
||||
if (typeof element.value === 'object') { element.value = JSON.stringify(element.value); }
|
||||
// element.value = JSON.stringify(element.value);
|
||||
delete element.description;
|
||||
@@ -1387,7 +1385,7 @@ module.exports = {
|
||||
item.request.body = pmBody.body;
|
||||
item.request.addHeader(pmBody.contentHeader);
|
||||
// extra form headers if encoding is present in request Body.
|
||||
pmBody.formHeaders.forEach((element) => {
|
||||
pmBody.formHeaders && pmBody.formHeaders.forEach((element) => {
|
||||
item.request.addHeader(element);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user