mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Update schemaUtils.js
handle diferent name of variables than baseUrl for webhooks
This commit is contained in:
@@ -4567,21 +4567,28 @@ module.exports = {
|
||||
*/
|
||||
getMissingSchemaEndpoints: function (schema, matchedEndpoints, components, options, schemaCache) {
|
||||
let endpoints = [],
|
||||
// schemaPaths = schema.paths,
|
||||
rootCollectionVariables,
|
||||
schemaJsonPath,
|
||||
schemaPathItems;
|
||||
|
||||
// collection variables generated for resolving for baseUrl and variables
|
||||
rootCollectionVariables = this.convertToPmCollectionVariables(
|
||||
schema.baseUrlVariables,
|
||||
'baseUrl',
|
||||
schema.baseUrl
|
||||
);
|
||||
schemaPathItems = concatPathsAndWebhooks(schema);
|
||||
_.forEach(schemaPathItems, (schemaPathObj, schemaPath) => {
|
||||
_.forEach(_.keys(schemaPathObj), (pathKey) => {
|
||||
schemaJsonPath = `$.${schemaPathObj.kind}[${schemaPath}].${_.toLower(pathKey)}`;
|
||||
if (schemaPathObj.kind === 'webhooks') {
|
||||
rootCollectionVariables = this.convertToPmCollectionVariables(
|
||||
schema.baseUrlVariables,
|
||||
schemaPath.startsWith('/') ? schemaPath.slice(1) : schemaPath,
|
||||
schema.baseUrl
|
||||
);
|
||||
}
|
||||
else {
|
||||
// collection variables generated for resolving for baseUrl and variables
|
||||
rootCollectionVariables = this.convertToPmCollectionVariables(
|
||||
schema.baseUrlVariables,
|
||||
'baseUrl',
|
||||
schema.baseUrl
|
||||
);
|
||||
}
|
||||
if (METHODS.includes(pathKey) && !matchedEndpoints.includes(schemaJsonPath)) {
|
||||
let mismatchObj = {
|
||||
property: 'ENDPOINT',
|
||||
|
||||
Reference in New Issue
Block a user