I want to load (require) a folder with json schemas that have references based on their file.
In other words I have
Schema1:
{ //Schema stuff ....
"$ref": "./json_schema2_file.json#someElement"
}
And in another file in the same folder:
Schema2
{//Schema stuff...
"$id": "/someElement"
}
These Schemas are in sperate files and now should be loaded into JS to be validated against a json object. However, the references inside the folder should still be valid.
That's why my question was, if and how it is possible to load a folder full of json files without references to break.
Those schemas will be used to validate json objects by this library: https://github.com/tdegrunt/jsonschema I'm personally using Node with Angular so using fs would only work for node, but would be a start.