-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add json schema for combined pp yaml #19
base: main
Are you sure you want to change the base?
Conversation
"pp_components": {"type":"string"} | ||
"history_segment": { | ||
"description": "Amount of time covered by a single history file (ISO8601 datetime)", | ||
"type":"string" |
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.
Thanks Dana, this looks great. Is it possible to define a custom "type" for the schema, do you know? That would be the best case scenario, if it were possible.
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.
Hm, I'm not sure. What would you want the type to be? Or do you mean custom as in it could be multiple types?
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.
The ISO8601 dates and durations would be great to validate, but seem hard to validate beyond "string". An enumerated list wouldn't quite work, since there are so many possibilities.
The way we "validate" the dates and durations now is attempt to parse it with metomi.isodatetime.parsers
and check if it succeeds or fails.
It would be great to catch typos like "P1M"/"PM1" during validation, but it may not be possible.
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.
Ah I see. It does look like you can specify specific values: https://www.tutorialspoint.com/yaml/yaml_json_schema.htm
we can have a list of values that would work maybe
@J-Lentz might know more on this too!
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.
Regular expression matching would be really nice.. let's keep an eye out for that.
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.
aha!! Uriel coming in clutch in a previous commit he's done:
646e68c
https://json-schema.org/understanding-json-schema/reference/regular_expressions
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.
Fantastic. Enumerations and regular expressions are about all what we had for the XML schema, I think.
Looks great so far, and pretty legible too. I'll add the analysis schema here. what about required or not? Is that a notion in json/yaml schemas? |
Yes! Here's an example in an FMS schema: gfdl_msd_schemas/FMS/data_table.json Line 49 in 2a19e66
|
FRE
folder