Skip to content

Commit 75b071e

Browse files
committed
adding id check to teh validation
1 parent 3b75984 commit 75b071e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

reproschema/validate.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ def validate_dir(
9292
if stop is not None:
9393
stop_server(stop)
9494
raise ValueError(f"Empty data graph in file {name}")
95+
if data["@id"].split("/")[-1] != name.split("/")[-1]:
96+
raise Exception(
97+
f"Document {data['@id']} does not match file name {name}"
98+
)
9599
conforms, vtext = validate_data(data)
96100
except (ValueError, json.JSONDecodeError):
97101
if stop is not None:

0 commit comments

Comments
 (0)