Skip to content

Issues with Search datetime parameter parsing - blank start or end range and lowercase t or z #161

Closed
@philvarner

Description

@philvarner

These issues were found on https://planetarycomputer.microsoft.com/api/stac/v1/ and locally running both the pgstac and sqlalchemy backends.

These datetime parameter values applied to /search should be accepted, but incorrectly return a 400:

Search with datetime=/1985-04-12T23:20:50.52Z returned status code 400
Search with datetime=1985-04-12T23:20:50.52Z/ returned status code 400

This is likely because only .. is accepted as an open ended interval, whereas blank string is also allowed per: "Open ranges in time intervals at the start or end are supported using a double-dot (..) or an empty string for the start/end." http://docs.opengeospatial.org/is/17-069r3/17-069r3.html#_parameter_datetime

This datetime string gave a 400, likely because it uses t and z, which is acceptable.

Search with datetime=1985-04-12t23:20:50.000z returned status code 400

A large number of valid RFC3339 strings can be found here: https://github.com/stac-utils/stac-api-validator/blob/afb5a91ed6ce804d6b33fb304d6532dd4c50a227/stac_api_validator/validations.py#L38

Metadata

Metadata

Assignees

Labels

specCompliance with STAC/OGC specifications

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions