Skip to content

data client and cli: get variable information from the spec #619

Open
@jreiberkyle

Description

@jreiberkyle

Right now the Data Client has hardcoded many variables (such as search sort order). This will break with API changes and will be hard to update. Change it over to obtaining the information directly from the spec e.g. one could get the search sort order valid and default entries like so:

>>> spec = json.load(open('data_spec_2022_06_29.json'))
>>> spec['parameters']['qSearchResultSort']['enum']
['acquired asc', 'acquired desc', 'published asc', 'published desc']
>>> spec['parameters']['qSearchResultSort']['default']
'published desc'

the spec can be downloaded directly from the api endpoint: https://api.planet.com/data/v1/spec

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions