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

Apply Code Embedder

parent e462584e
No related branches found
No related tags found
No related merge requests found
......@@ -31,5 +31,20 @@ This schema defines the properties for projection data in THD JSON format.
### Examples
```python:../scripts/validate_thd_json.py:o:main
def main():
with open(str(SHEMA)) as schema_file, open(str(FILE)) as data_file:
schema = json.load(schema_file)
data = json.load(data_file)
print(f"JSON Schema: {schema['title']}")
print(f"Validate File: {FILE.parent} / {FILE.name}\n")
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)
```
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