diff --git a/lib/index.js b/lib/index.js index 5a3d427..4b7b3cb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -46,7 +46,8 @@ async function postmanToOpenApi (input, output, { const { path, query, protocol, host, port, valid, pathVars } = scrapeURL(url) if (valid) { // Remove from name the possible operation id between brackets - const summary = name.replace(/ \[(.*?)\]/gi, '') + // eslint-disable-next-line no-useless-escape + const summary = name.replace(/ \[([^\[\]]*)\]/gi, '') domains.add(calculateDomains(protocol, host, port)) const joinedPath = calculatePath(path, pathDepth) if (!paths[joinedPath]) paths[joinedPath] = {} @@ -630,7 +631,8 @@ function calculateOperationId (mode, name, summary) { operationId = camelCase(summary) break case 'brackets': { - const matches = name.match(/\[([^()]*)\]/) + // eslint-disable-next-line no-useless-escape + const matches = name.match(/\[([^\[\]]*)\]/) operationId = matches ? matches[1] : undefined break }