Open ibevers opened 6 months ago
should this be true for all classes or only for some specific ones, e.g. Item
?
activity, protocol, and item are the ones that use id dereferencing on github and locally, hence those.
I had this code snipper lying around on one of my repos if that helps.
import json
import os
tested = 0
for root, _, files in os.walk("schemas", topdown=True):
for name in files:
filename = os.path.join(root, name)
with open(filename) as fp:
try:
tested += 1
data = json.load(fp)
if data["@id"] and data["@id"] != name:
raise ValueError(f"{root}/{name} does not have matching @id")
except json.decoder.JSONDecodeError:
print(f"{root}/{name} could not be loaded")
raise
if tested == 0:
raise ValueError("Zero files tested")
@djarecka did our new reproschema model solve this?
From @satra @djarecka : "@id needs to match the filename" "if validation is passing with this, please ask dorota to add that to the validator"