Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend implementation for queryables in the labextension #162

Open
alambare opened this issue Dec 4, 2024 · 0 comments
Open

backend implementation for queryables in the labextension #162

alambare opened this issue Dec 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@alambare
Copy link
Collaborator

alambare commented Dec 4, 2024

EODAG recent update introduced the list_queryables() method. This method exposes a list of known filters for users helping them to create valid requests for their preferred provider and product_type.

This change is the first part to bring this improvement to the labextension.

We need a API endpoint that can be called by the front to retrieve the queryables for a specific provider and product_type.

The queryables endpoint must return a json schema containing all the queryables in a properties key. A required property with a list of required properties' name as values. The additionalProperties bool to specify whether additional properties are allowed.

We can retrieve the json schema using pydantic like the following

queryables_dict = dag.list_queryables(provider="cop_ads", productType="CAMS_GAC_FORECAST")
json_schema = queryables_dict.get_model().model_json_schema()

The None default values of properties should me removed as they make ugly json schema with pydantic.
See how this is done in the server mode: https://github.com/CS-SI/eodag/blob/develop/eodag/rest/core.py#L619-L620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant