Skip to content

Commit a939dc5

Browse files
committed
update stac lint to work with v0.8.0, v0.8.1, v0.9.0
1 parent 79b90c4 commit a939dc5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

stac_validator/stac_validator.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ def fetch_spec(self, spec):
119119
else:
120120
spec_name = "item"
121121

122-
if self.stac_version == 'v1.0.0-beta.2':
123-
self.stac_version = '1.0.0-beta.2'
124-
if self.stac_version == '1.0.0-beta.2':
122+
pystacVersions1 = ['v0.8.0','v0.8.1','v0.9.0','v1.0.0-beta.2']
123+
pystacVersions2 = ['0.8.0','0.8.1','0.9.0','1.0.0-beta.2']
124+
if self.stac_version in pystacVersions1:
125+
self.stac_version = self.stac_version[1:]
126+
if self.stac_version in pystacVersions2:
125127
valid_dir = True
126128
elif self.stac_spec_dirs is None:
127129
try:
@@ -195,7 +197,8 @@ def validate_json(self, stac_content, stac_schema):
195197
"file://" + self.dirpath + "/geojson.json#definitions/feature"
196198
)
197199
logging.info("Validating STAC")
198-
if self.stac_version=='1.0.0-beta.2':
200+
pystacVersions = ['0.8.0','0.8.1','0.9.0','1.0.0-beta.2']
201+
if self.stac_version in pystacVersions:
199202
pystac.validation.validate_dict(stac_content, stac_version=self.stac_version)
200203
else:
201204
validate(stac_content, stac_schema)

0 commit comments

Comments
 (0)