diff --git a/lib/merge_json.js b/lib/merge_json.js index 0887049..8b87145 100644 --- a/lib/merge_json.js +++ b/lib/merge_json.js @@ -64,7 +64,7 @@ function removeJSONBlock (s) { * @api private */ function mergeJSONByRef (param, dir, file, doc) { - return doc.replace(/\s*("\$ref")( *):( *)"[^"{}]+"\s*/gm, s => { + return doc.replace(/\s*("\$ref")( *):( *)"[^"]+"\s*/gm, s => { let ref = JSON.parse('{' + s + '}').$ref.trim() if (ref.startsWith('#/') && file !== param.input) { ref = cacheRef(path.basename(file) + ref)