mirror of
https://github.com/syoyo/tinygltf.git
synced 2026-10-04 16:05:43 +00:00
Add workaround for parsing glTF schemas
This commit is contained in:
@@ -86,8 +86,11 @@ void json_uri::from_string(const std::string &uri)
|
||||
auto path = url.substr(pos);
|
||||
if (path[0] == '/') // if it starts with a / it is root-path
|
||||
path_ = path;
|
||||
else // otherwise it is a subfolder
|
||||
path_.append(path);
|
||||
else { // otherwise it is a subfolder
|
||||
// HACK(syoyo): Force append '/' for glTF json schemas
|
||||
path_ = path;
|
||||
//path_.append(path);
|
||||
}
|
||||
|
||||
pointer_ = json_pointer("");
|
||||
}
|
||||
|
||||
@@ -278,7 +278,9 @@ void json_validator::insert_schema(const json &input, const json_uri &id)
|
||||
// check whether all schema-references are new
|
||||
for (auto &sref : r.schema_refs) {
|
||||
if (schema_refs_.find(sref.first) != schema_refs_.end())
|
||||
throw std::invalid_argument("schema " + sref.first.to_string() + " already present in validator.");
|
||||
// HACK(syoyo): Skip duplicated schema.
|
||||
break;
|
||||
//throw std::invalid_argument("schema " + sref.first.to_string() + " already present in validator.");
|
||||
}
|
||||
// no undefined references and no duplicated schema - store the schema
|
||||
schema_store_.push_back(schema);
|
||||
|
||||
Reference in New Issue
Block a user