mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Adding descriptions as fallback in webhooks name, Avoid webhooks folder creation when there are not any webhook in the file and includeWebhooks is true, ignoring local and global servers in webhooks
This commit is contained in:
@@ -660,6 +660,10 @@ module.exports = {
|
||||
variableStore = {},
|
||||
webhooksVariables = [];
|
||||
|
||||
if (Object.keys(webhooksTree.root.children).length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let child in webhooksTree.root.children) {
|
||||
if (
|
||||
webhooksTree.root.children.hasOwnProperty(child) &&
|
||||
@@ -2232,10 +2236,10 @@ module.exports = {
|
||||
pmBody,
|
||||
authMeta,
|
||||
swagResponse,
|
||||
localServers = _.get(operationItem, 'properties.servers'),
|
||||
localServers = fromWebhooks ? '' : _.get(operationItem, 'properties.servers'),
|
||||
exampleRequestBody,
|
||||
sanitizeResult,
|
||||
globalServers = _.get(operationItem, 'servers'),
|
||||
globalServers = fromWebhooks ? '' : _.get(operationItem, 'servers'),
|
||||
responseMediaTypes,
|
||||
acceptHeader;
|
||||
|
||||
@@ -2341,7 +2345,7 @@ module.exports = {
|
||||
if (fromWebhooks) {
|
||||
reqName = utils.insertSpacesInName(operation.operationId) ||
|
||||
operation.summary ||
|
||||
`${this.cleanWebhookName(operationItem.path)} - ${operationItem.method}`;
|
||||
operation.description;
|
||||
}
|
||||
else {
|
||||
reqName = operation.summary || utils.insertSpacesInName(operation.operationId) || reqUrl;
|
||||
|
||||
Reference in New Issue
Block a user