Commit 531d13ff authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Fixed need to add core schema to supporting schemas

parent 7e86850c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@ def check_refs(schema: Validator, resolver: RefResolver) -> List[RefResolutionEr
        
        
def build_schema(core_schema_path: str | Path, supporting_schema_paths: Sequence[Path | str] = None) -> Tuple[Draft202012Validator | None, list[BuildResult]]:
def build_schema(core_schema_path: str | Path, supporting_schema_paths: Sequence[Path | str] = None) -> Tuple[Draft202012Validator | None, list[BuildResult]]:
    core_schema_path = Path(core_schema_path)
    core_schema_path = Path(core_schema_path)
    _schema_dict = {}
    if not core_schema_path.exists():
    if not core_schema_path.exists():
        logging.warning(f"Cannot find core schema file {core_schema_path} for schema files")
        logging.warning(f"Cannot find core schema file {core_schema_path} for schema files")
        return None, [BuildResult(core_schema_path, False, [FileNotFoundError(f"Cannot find file {core_schema_path}")])]
        return None, [BuildResult(core_schema_path, False, [FileNotFoundError(f"Cannot find file {core_schema_path}")])]
@@ -50,7 +51,6 @@ def build_schema(core_schema_path: str | Path, supporting_schema_paths: Sequence
            _supporting_paths.append(path)
            _supporting_paths.append(path)
    logging.info(f"Supporting schema paths: {_supporting_paths}")
    logging.info(f"Supporting schema paths: {_supporting_paths}")
    _supporting_schemas = []
    _supporting_schemas = []
    _schema_dict = {}
    for path in _supporting_paths:
    for path in _supporting_paths:
        try:
        try:
            new_schema = load(path.open())
            new_schema = load(path.open())