2222 PathOrUrl , get_git_repo_url
2323from ogc .bblocks .schema import annotate_schema , resolve_all_schema_references , write_annotated_schema
2424from ogc .bblocks .models import BuildingBlock , BuildingBlockRegister , ImportedBuildingBlocks , BuildingBlockError
25- from ogc .bblocks .validate import validate_test_resources , report_to_html
25+ from ogc .bblocks .validate import validate_test_resources , write_report
2626from ogc .bblocks .transform import apply_transforms , transformers
2727
2828
@@ -407,14 +407,19 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
407407 print (f"{ building_block .identifier } failed postprocessing, skipping..." , file = sys .stderr )
408408
409409 full_validation_report_url = None
410+ full_validation_report_url_json = None
410411 if not steps or 'tests' in steps :
411- print (f"Writing full validation report to { test_outputs_path / 'report.html' } " , file = sys .stderr )
412+ print (f"Writing validation report to { test_outputs_path / 'report.html' } and "
413+ f"{ test_outputs_path / 'report.json' } " , file = sys .stderr )
412414 if base_url :
413415 full_validation_report_url = (f"{ base_url } { os .path .relpath (Path (test_outputs_path ).resolve (), cwd )} "
414416 f"/report.html" )
415- report_to_html (json_reports = validation_reports ,
416- report_fn = test_outputs_path / 'report.html' ,
417- base_url = base_url )
417+ full_validation_report_url_json = (f"{ base_url } { os .path .relpath (Path (test_outputs_path ).resolve (), cwd )} "
418+ f"/report.json" )
419+ write_report (json_reports = validation_reports ,
420+ report_fn = test_outputs_path / 'report.html' ,
421+ json_report_fn = test_outputs_path / 'report.json' ,
422+ base_url = base_url )
418423
419424 if output_file and (not steps or 'register' in steps ):
420425
@@ -430,6 +435,8 @@ def do_postprocess(bblock: BuildingBlock, light: bool = False) -> bool:
430435
431436 if full_validation_report_url :
432437 output_register_json ['validationReport' ] = full_validation_report_url
438+ if full_validation_report_url_json :
439+ output_register_json ['validationReportJson' ] = full_validation_report_url_json
433440
434441 if additional_metadata :
435442 output_register_json = {
0 commit comments