-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
First step in addressing Issue #334.
- 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.
- 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.
Travis builds are failing, but this is because of seven unit tests which are also currently failing in master. |
There was a problem hiding this 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)
There was a problem hiding this 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..
Co-authored-by: Norman Fomferra <[email protected]>
Co-authored-by: Norman Fomferra <[email protected]>
Co-authored-by: Norman Fomferra <[email protected]>
Co-authored-by: Norman Fomferra <[email protected]>
UI generation is now described as using the JSON Schema itself as the definition, rather than the xcube jsonschema classes.
Co-authored-by: Norman Fomferra <[email protected]>
Co-authored-by: Norman Fomferra <[email protected]>
- 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.
Co-authored-by: Norman Fomferra <[email protected]>
There was a problem hiding this 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...
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.
min_datetime
andmax_datetime
toJSONStringSchema
to make results ofget_open_data_params_schema
more fully descriptive.opener_parameters_api.md
to documentation (a detailed description of how the opener parameters JSON Schema should be used by openers and UI generators).