From 85fd816c8bb4ef79da43cea1552aaae185d379c4 Mon Sep 17 00:00:00 2001 From: "Esteban Prince, Liam (UG - Computer Science)" <le00210@surrey.ac.uk> Date: Mon, 24 Feb 2020 17:21:46 +0000 Subject: [PATCH] Update preprocessor.py --- preprocessor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/preprocessor.py b/preprocessor.py index 57c9c8a..f1a5e73 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -1,4 +1,5 @@ import json +from jsonschema import validate with open('recipes/vegancupcakes.json', 'r') as f: recipes = json.load(f) @@ -31,5 +32,7 @@ def addMissingUnits(): pass # Check that everything in the database conforms to the schema -def conform(): - pass \ No newline at end of file +def validateSchema(): + # for each json file in database/ + validate(schema, file) + \ No newline at end of file -- GitLab