-
Notifications
You must be signed in to change notification settings - Fork 57
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
Improves Covering Schema #208 #209
Conversation
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.
This looks good to me. Two thoughts:
- Add an invalid example to scripts/test_json_schema.py to show that empty name as the first column name will fail.
- bbox is now required but should additional properties be allowed per your comment in Covering Schema #208? If so, you could add
additionalProperties: false
to covering... but maybe it's fine to leave for now.
Tests added.
I'm not sure what the intention was here. How it is in this PR it seems most reasonable to me, but maybe there was another intention. I hope others can clarify. |
"required": [ | ||
"bbox" | ||
], |
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.
I don't think we want to make this required if we want to add other covering types in the future. Or would we remove this required
when we add the future covering type?
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.
Or is there some way to define the specific key names allowed? E.g. that today we only allow the "bbox" key inside coverings
, but that in the future other keys may be allowed as well?
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.
Yeah, that's the question. I mean right now it's required, isn't it? Otherwise it's empty or someone puts anything else.
In the future the requirement could be relaxed of course, but for 1.1 it doesn't feel very useful to not require it?!
With regards to your second comment, I'm not sure I understand what you are looking for.
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.
With regards to your second comment, I'm not sure I understand what you are looking for.
My understanding is that your change means that a bbox
key is now required. Instead, is there some way in JSON schema to allow an enum of values? So we currently define an enum with a single variant but can expand that in the future?
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.
You could do something like the following to indicate that you expect more fields in the future where having one of them is required:
"anyOf": [
{ "required": ["bbox"] }
]
It's not really different though, it's just an implicit indication for people reading the schema.
The question really is:
Are covering: {}
or e.g. covering: { a: "b" }
something that should be allowed in 1.1? Or do we always expect that in 1.1 there is a bbox member in covering? I couldn't really figure out what the intention is...
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.
I think the expectation is that if the covering
key exists, then it has a bbox
member key.
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.
Then the PR is correct. If you want I can update it to the anyOf, I'm pretty neutral on it. What do others think?
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.
Agreed. I think it's fine as-is. Whenever more options are added, the "required": ["bbox"]
can change to anyOf or oneOf without losing the meaning. And since only the outermost element has additionalProperties set to false, it seems consistent to leave it out here.
What's the status of this one? @jwass - you want to give this an approval? Let's get this one merged in unless anyone has objections. |
Fixes #208