Skip to content

Add date limits to JSON schema and document opener parameters API #336

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

Merged
merged 29 commits into from
Sep 25, 2020

Conversation

pont-us
Copy link
Member

@pont-us pont-us commented Sep 21, 2020

  • Add min_datetime and max_datetime to JSONStringSchema to make results of get_open_data_params_schema more fully descriptive.
  • Add opener_parameters_api.md to documentation (a detailed description of how the opener parameters JSON Schema should be used by openers and UI generators).

 - Add a format_checker argument to JsonSchema.validate_instance, so
   that supported string formats will be validated.

 - Add the strict-rfc3339 package to the project requirements to allow
   jsonschema to validate the "date-time" format.

 - Add more thorough parameter checking for date and time limits to
   JsonStringSchema.

 - Add unit tests for the new functionality.
 - Add a first, incomplete draft of the store plugin API and opener
   parameters.

 - Add mention of CCI and CDS plugins to the plugins documentation.
By default, only Python lists validate against jsonschema's array
schema. This commit adds an option to the call to jsonschema.validate
in JsonSchema.validate_instance to make sure that Python tuples will
also validate as jsonschema arrays.
@pont-us pont-us marked this pull request as draft September 21, 2020 14:02
 - Make CubeConfig.get_schema return a schema which permits both "date"
   and "date-time" formats for the time range endpoints. Previously
   only "date-time" was allowed, but it made no difference because the
   string format was not being validated.

 - Add support for the "anyOf" keyword in xcube.util.jsonschema, required
   in order to implement the previous item.
@pont-us pont-us marked this pull request as ready for review September 23, 2020 08:32
@pont-us
Copy link
Member Author

pont-us commented Sep 23, 2020

Travis builds are failing, but this is because of seven unit tests which are also currently failing in master.

@pont-us pont-us requested review from forman and dzelge September 23, 2020 08:34
Copy link
Contributor

@dzelge dzelge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool docs. If I understand correctly time periods are specified only by a duration character e.g. M or Y. However, they are in the same chapter of the date/time RFC you quoted. I'd just mention it In the chapter Date, time, and duration. (I left a remark)

Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very goodm thanks a lot. However, as you can see, we should further discuss some points..

pont-us and others added 13 commits September 23, 2020 11:58
UI generation is now described as using the JSON Schema itself as
the definition, rather than the xcube jsonschema classes.
 - Create a JsonDatetimeSchema subclass of JsonStringSchema to
   make it more convenient to create schemas with date and date-time
   formats.

 - Use JsonDatetimeSchema in the schema returned by CubeConfig.get_schema.
Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Its only the CHANGES.md, I believe...

pont-us and others added 6 commits September 25, 2020 09:45
Co-authored-by: Norman Fomferra <[email protected]>
Co-authored-by: Norman Fomferra <[email protected]>
The new name is more appropriate for the planned scope of the document.
Implement a convenience method JsonDatetimeSchema.new_datetime_range and use
it in CubeConfig.get_schema. Add some TODO comments about anyOf in
jsonschema.py.
 - In store conventions document, define a format for time specifiers.

 - Use this format in the schema returned by CubeConfig.get_schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants