Skip to content

Commit 7465eb5

Browse files
committed
Fixed validation for relative references
1 parent ebc2d90 commit 7465eb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

forward_engineering/api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ const replaceRelativePathByAbsolute=(script, modelDirectory)=>{
159159
const fixedScript= stringifiedScript.replace(/("\$ref":\s*)"(.*?(?<!\\))"/g, (match, refGroup, relativePath)=>{
160160
const isAbsolutePath=relativePath.startsWith('file:');
161161
const isInternetLink=relativePath.startsWith('http:') || relativePath.startsWith('https:');
162+
const isModelRef=relativePath.startsWith('#');
162163

163-
if(isAbsolutePath || isInternetLink){
164+
if(isAbsolutePath || isInternetLink || isModelRef){
164165
return match
165166
}
166167
const absolutePath=path.resolve(modelDirectory, '..',relativePath)

0 commit comments

Comments
 (0)