Skip to content

Commit

Permalink
fix: issue #78, skip merge definition that include {}.
Browse files Browse the repository at this point in the history
  • Loading branch information
WindomZ committed Mar 2, 2022
1 parent 24178ab commit 11ed8ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/merge_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 11ed8ab

Please sign in to comment.