Korving-F / DACA

DAtaset Creation Aquisition engine
MIT License
4 stars 0 forks source link

Adds Scenario Schema + Schema Validation logic #13

Closed Korving-F closed 2 years ago

Korving-F commented 2 years ago

This addition adds a specification of a Scenario description file and code to validate adherence, Example:

from cerberus import Validator
import yaml

schema = {'name': {'type': 'string'}}
v = Validator(schema)

with open('scenario_file.yaml', 'r') as f:
    data = yaml.safe_load(f)

if v.validate(self.scenario_path):
    print("Scenario is valid according to schema")
else:
    print(f'The scenario failed validation: {v.errors}')