Skip to content
Snippets Groups Projects
Commit bec9610a authored by Simon Wittl's avatar Simon Wittl
Browse files

changed example validate

parent 039c88ae
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,14 @@ def main():
schema = json.load(schema_file)
data = json.load(data_file)
print(f"JSON Schema: {schema['title']}")
print(f"JSON Schema (Version): {schema['version']}")
print(f"JSON Schema (Date): {schema['date']}\n\n")
try:
validate(instance=data, schema=schema)
print("JSON is valid.")
except ValidationError as e:
print("Validation error:", e)
......
......@@ -3,6 +3,7 @@
"title": "THD Projection File Schema",
"type": "object",
"version": 0.1,
"date": "04.11.2024",
"properties": {
"focal_spot_position_mm": {
"type": "array",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment