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

Extend store open params schema to allow date limits #334

Closed
pont-us opened this issue Sep 15, 2020 · 1 comment
Closed

Extend store open params schema to allow date limits #334

pont-us opened this issue Sep 15, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@pont-us
Copy link
Member

pont-us commented Sep 15, 2020

Currently, the JSON schemas returned by the get_open_data_params_schema methods of data opener plugins (defined in xcube/core/store/accessor.py) can't specify an allowed range of dates. The returned schema can contain something like:

            time_range=JsonArraySchema(
                items=[JsonStringSchema(format='date-time'),
                       JsonStringSchema(format='date-time', nullable=True)]),

However, this gives no indication as to the supported range of dates. Unfortunately, JSON Schema does not allow "minimum" and "maximum" parameters to be specified for a date string (see json-schema-org/json-schema-spec#99 and json-schema-org/json-schema-spec#116 ). However, we could add an unofficial extension by adding (for example) optional min_datetime and max_datetime arguments to the JsonStringSchema constructor. The automatic JSON validation would of course not be able to deal with these, but they could be stored in fields for users of get_open_data_params_schema (e.g. UI builders).

@pont-us pont-us changed the title Extend store open params schema to include date limits Extend store open params schema to allow date limits Sep 15, 2020
@pont-us pont-us self-assigned this Sep 15, 2020
@pont-us pont-us added the enhancement New feature or request label Sep 15, 2020
pont-us added a commit that referenced this issue Sep 15, 2020
@pont-us
Copy link
Member Author

pont-us commented Oct 8, 2020

Closed by PR #336 .

@pont-us pont-us closed this as completed Oct 8, 2020
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