diff --git a/models/Odmdb.js b/models/Odmdb.js index 6f3aa21..6f9c8dd 100644 --- a/models/Odmdb.js +++ b/models/Odmdb.js @@ -232,7 +232,7 @@ Odmdb.Schema = (objectPathname, validschema, lg="en") => { res.data.schema.properties[p].type == "object" && res.data.schema.properties[p]["$ref"] ) { - const subschema = getpath(res.data.schema.properties[p]["$ref"]); + const subschema = path.resolve(`${objectPathname}/${res.data.schema.properties[p]["$ref"]}`); if (Object.keys(res.data.schema).length == 0) { res.status = 404; res.msg = "missingref"; @@ -250,6 +250,7 @@ Odmdb.Schema = (objectPathname, validschema, lg="en") => { res.data.schema.properties[p].options["$ref"] ) { const optionsfile = path.resolve(`${objectPathname}/${res.data.schema.properties[p].options["$ref"]}`) + if (log) console.log(currentmod,"Lien vers options:", optionsfile) if (!fs.existsSync(optionsfile)){ res.status = 404; res.msg = "missingref";