Skip to content

Commit c10da9c

Browse files
committed
Collecting errors in array and providing to user if needed
1 parent 9059a14 commit c10da9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/python_lib_osw_validation/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, schema_dir: str):
1010
self.schema_dir = schema_dir
1111
self.schema = self.load_osw_schema(Path(self.schema_dir, 'opensidewalks.schema.json'))
1212
self.region_id = 'wa.microsoft'
13-
self.errors = None
13+
self.errors = []
1414

1515
def load_osw_schema(self, schema_path: str) -> Dict[str, Any]:
1616
"""Load OSW Schema"""
@@ -33,12 +33,12 @@ def validate_osw_errors(self, geojson_data: Dict[str, Any]) -> bool:
3333
for error in errors:
3434
error_count += 1
3535
# Format and store in file for further review
36-
self.errors = error
36+
self.errors.append(error)
3737

3838
return error_count == 0
3939

4040
def validate(self) -> None:
41-
self.errors = None
41+
self.errors = []
4242
# Validate edges
4343
is_valid = self.validate_osw_errors(
4444
self.load_osw_file(Path(self.schema_dir, f"{self.region_id}.graph.edges.OSW.geojson")))

0 commit comments

Comments
 (0)