|
11 | 11 |
|
12 | 12 | from .utilities import (
|
13 | 13 | fetch_and_parse_file,
|
| 14 | + fetch_and_parse_schema, |
14 | 15 | get_stac_type,
|
15 | 16 | link_request,
|
16 | 17 | set_schema_addr,
|
@@ -150,15 +151,15 @@ def extensions_validator(self, stac_type: str) -> dict:
|
150 | 151 | def custom_validator(self):
|
151 | 152 | # in case the path to custom json schema is local
|
152 | 153 | # it may contain relative references
|
153 |
| - schema = fetch_and_parse_file(self.custom) |
| 154 | + schema = fetch_and_parse_schema(self.custom) |
154 | 155 | if os.path.exists(self.custom):
|
155 | 156 | custom_abspath = os.path.abspath(self.custom)
|
156 | 157 | custom_dir = os.path.dirname(custom_abspath).replace("\\", "/")
|
157 | 158 | custom_uri = f"file:///{custom_dir}/"
|
158 | 159 | resolver = RefResolver(custom_uri, self.custom)
|
159 | 160 | jsonschema.validate(self.stac_content, schema, resolver=resolver)
|
160 | 161 | else:
|
161 |
| - schema = fetch_and_parse_file(self.custom) |
| 162 | + schema = fetch_and_parse_schema(self.custom) |
162 | 163 | jsonschema.validate(self.stac_content, schema)
|
163 | 164 |
|
164 | 165 | def core_validator(self, stac_type: str):
|
@@ -233,7 +234,7 @@ def recursive_validator(self, stac_type: str):
|
233 | 234 | self.custom = set_schema_addr(self.version, stac_type.lower())
|
234 | 235 | message = self.create_message(stac_type, "recursive")
|
235 | 236 | if self.version == "0.7.0":
|
236 |
| - schema = fetch_and_parse_file(self.custom) |
| 237 | + schema = fetch_and_parse_schema(self.custom) |
237 | 238 | # this next line prevents this: unknown url type: 'geojson.json' ??
|
238 | 239 | schema["allOf"] = [{}]
|
239 | 240 | jsonschema.validate(self.stac_content, schema)
|
|
0 commit comments