Skip to content

Commit a514ea5

Browse files
committed
works for extensions on staclint
1 parent 1f0c954 commit a514ea5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

stac_validator/Archive.zip

93.1 KB
Binary file not shown.

stac_validator/stac_validator.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def validate_json(self, stac_content, stac_schema):
201201
:param stac_schema of STAC (item, catalog, collection)
202202
:return: validation message
203203
"""
204-
print(json.dumps(stac_content, indent=4))
204+
#print(json.dumps(stac_content, indent=4))
205205

206206
#valid - python3 stac_validator.py https://raw.githubusercontent.com/radiantearth/stac-spec/master/item-spec/examples/sample-full.json --extension eo --version 1.0.0-beta.2
207207
#invalid - python3 stac_validator.py https://raw.githubusercontent.com/radiantearth/stac-spec/master/item-spec/examples/sample-full.json --extension eo --version 0.9.0
@@ -222,16 +222,18 @@ def validate_json(self, stac_content, stac_schema):
222222
# if self.extension not in extension_list:
223223
# raise ExtensionException
224224
if self.extension in extension_list:
225-
print(self.extension)
225+
pass
226+
#print(self.extension)
226227

227-
print(self.extension)
228+
# print(self.extension)
228229
# print(self.stac_version)
229-
if(self.extension):
230-
# message["extension_flag"] = self.extension
230+
if(self.extension != 'None'):
231+
print("here")
232+
message["extension_flag"] = self.extension
231233
stacschema = pystac.validation.JsonSchemaSTACValidator()
232234
self.stac_type = self.get_stac_type(stac_content)
233-
print(self.stac_type)
234-
print("here")
235+
# print(self.stac_type)
236+
# print("here")
235237
self.stac_type = self.stac_type.upper()
236238
# self.stac_version = '1.0.0-beta.2'
237239
stacschema.validate_extension(stac_dict=stac_content, stac_object_type=self.stac_type, stac_version=self.stac_version, extension_id=self.extension)

0 commit comments

Comments
 (0)