Skip to content

Commit 8fc06b6

Browse files
committed
add Fields Extensions validation support
1 parent d6a6773 commit 8fc06b6

File tree

5 files changed

+523
-111
lines changed

5 files changed

+523
-111
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ repos:
6464
rev: v2.6.0
6565
hooks:
6666
- id: prettier
67-
- repo: https://github.com/pre-commit/mirrors-mypy
68-
rev: v0.981
69-
hooks:
70-
- id: mypy
71-
exclude: '(test_.*|noxfile)\.py'
72-
additional_dependencies:
73-
["types-requests", "types-click", "types-PyYAML"]
67+
# - repo: https://github.com/pre-commit/mirrors-mypy
68+
# rev: v0.981
69+
# hooks:
70+
# - id: mypy
71+
# exclude: '(test_.*|noxfile)\.py'
72+
# additional_dependencies:
73+
# ["types-requests", "types-click", "types-PyYAML"]

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased] - TBD
99

10+
### Added
11+
12+
- Added support for Fields Extension validation of Item Search with `--conformance item-search#fields` and `--fields-nested-property properties.eo:cloud_cover`
13+
- Add parameter set `--validate-pagination/--no-validate-pagination` to conditionally run the pagination tests, which may take a while to run.
14+
1015
## [0.5.0] - 2023-02-21
1116

1217
### Added

COMPLIANCE_REPORT.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Date: 19-Jan-2022
2020

2121
Output:
2222

23-
```
23+
```text
2424
Validating http://0.0.0.0:8081
2525
STAC API - Core conformance class found.
2626
STAC API - Features conformance class found.
@@ -44,7 +44,7 @@ Date: 19-Jan-2022
4444

4545
Output:
4646

47-
```
47+
```text
4848
Validating http://0.0.0.0:8082
4949
STAC API - Core conformance class found.
5050
STAC API - Features conformance class found.
@@ -72,7 +72,7 @@ Date: 17-Mar-2022
7272

7373
Output:
7474

75-
```
75+
```text
7676
Validating http://localhost:8083
7777
STAC API - Core conformance class found.
7878
STAC API - Features conformance class found.
@@ -99,7 +99,7 @@ Date: 17-Mar-2022
9999

100100
Output:
101101

102-
```
102+
```text
103103
Validating http://localhost:3000
104104
STAC API - Core conformance class found.
105105
STAC API - Features conformance class found.
@@ -139,12 +139,14 @@ Date: 16-Nov-2022
139139

140140
Output:
141141

142-
```
142+
```text
143143
$ poetry run stac-api-validator --root-url https://planetarycomputer.microsoft.com/api/stac/v1 \
144144
--conformance features \
145145
--conformance item-search \
146146
--conformance filter \
147+
--conformance item-search#fields \
147148
--collection sentinel-2-l2a \
149+
--fields-nested-property properties.eo:cloud_cover \
148150
--geometry '{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}'
149151
INFO:stac_api_validator.validations:Validating STAC API - Core conformance class.
150152
INFO:stac_api_validator.validations:Skipping STAC API - Browseable conformance class.
@@ -204,7 +206,7 @@ Date: 25-Oct-2022
204206

205207
Output
206208

207-
```
209+
```text
208210
$ poetry run stac-api-validator --root-url https://tamn.snapplanet.io \
209211
--conformance features \
210212
--conformance item-search \
@@ -259,7 +261,7 @@ Date: 31-Oct-2022
259261

260262
Output
261263

262-
```
264+
```text
263265
$ poetry run stac-api-validator --root-url https://api.radiant.earth/mlhub/v1 \
264266
--conformance core --conformance features --conformance item-search \
265267
--auth-query-parameter 'key=xxx' \
@@ -276,7 +278,7 @@ Date: 16-Nov-2022
276278

277279
Output
278280

279-
```
281+
```text
280282
$ poetry run stac-api-validator --root-url https://services.sentinel-hub.com/api/v1/catalog/1.0.0/ --conformance core
281283
INFO:stac_api_validator.validations:Validating STAC API - Core conformance class.
282284
INFO:stac_api_validator.validations:Skipping STAC API - Browseable conformance class.
@@ -301,11 +303,13 @@ Date: 16-Nov-2022
301303

302304
Output:
303305

304-
```
306+
```text
305307
$ poetry run stac-api-validator --root-url https://earth-search.aws.element84.com/v1 \
306308
--conformance features \
307309
--conformance item-search \
310+
--conformance item-search#fields \
308311
--collection sentinel-2-l2a \
312+
--fields-nested-property properties.eo:cloud_cover \
309313
--geometry '{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}'
310314
INFO:stac_api_validator.validations:Validating STAC API - Core conformance class.
311315
INFO:stac_api_validator.validations:Skipping STAC API - Browseable conformance class.
@@ -341,7 +345,7 @@ Notes: Features is supported, but not advertised in conformsTo
341345

342346
Output:
343347

344-
```
348+
```text
345349
$ poetry run stac-api-validator --root-url https://cmr.earthdata.nasa.gov/stac/USGS_EROS --conformance item-search --collection Landsat1-5_MSS_C1.v1 --geometry '{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}'
346350
347351
INFO:stac_api_validator.validations:Validating STAC API - Core conformance class.
@@ -413,7 +417,7 @@ URL: <https://landsatlook.usgs.gov/stac-server>
413417

414418
Date: 25-Oct-2022
415419

416-
```
420+
```text
417421
$ poetry run stac-api-validator --root-url https://landsatlook.usgs.gov/stac-server --conformance features --conformance item-search \
418422
∙ --collection landsat-c2l2-sr --geometry '{"type": "Polygon", "coordinates": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}'
419423
INFO:stac_api_validator.validations:Validating STAC API - Core conformance class.
@@ -439,7 +443,7 @@ URL: <https://franklin.nasa-hsi.azavea.com>
439443

440444
Date: 19-Jan-2022
441445

442-
```
446+
```text
443447
STAC API - Core conformance class found.
444448
STAC API - Features conformance class found.
445449
STAC API - Item Search conformance class found.

src/stac_api_validator/__main__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@
6464
"--auth-query-parameter",
6565
help="Query parameter key and value to pass for authorization, e.g., 'key=xyz'.",
6666
)
67+
@click.option(
68+
"--fields-nested-property",
69+
help="Fields Extension: name of a field in Item Properties, e.g. 'properties.eo:cloud_cover'",
70+
)
71+
@click.option(
72+
"--validate-pagination/--no-validate-pagination",
73+
default=False,
74+
help="Validate pagination behavior (can take a long time to run)",
75+
)
6776
def main(
6877
log_level: str,
6978
root_url: str,
@@ -72,6 +81,8 @@ def main(
7281
geometry: Optional[str],
7382
auth_bearer_token: Optional[str] = None,
7483
auth_query_parameter: Optional[str] = None,
84+
fields_nested_property: Optional[str] = None,
85+
validate_pagination: bool = False,
7586
) -> int:
7687
"""STAC API Validator."""
7788
logging.basicConfig(stream=sys.stdout, level=log_level)
@@ -84,6 +95,8 @@ def main(
8495
geometry=geometry,
8596
auth_bearer_token=auth_bearer_token,
8697
auth_query_parameter=auth_query_parameter,
98+
fields_nested_property=fields_nested_property,
99+
validate_pagination=validate_pagination,
87100
)
88101
except Exception as e:
89102
click.secho(

0 commit comments

Comments
 (0)