-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Require that version_removed is either a string or true #9015
Conversation
This still needs work to actually enforce it, but I'm not sure if it's should go in |
Change |
Setting it explicitly to null or false is meaningless.
0f831e2
to
518847c
Compare
"description": "A string the value true, indicating which browser version added this feature, or the value false indicating the feature is not supported, or the value null indicating support is unknown.", | ||
"allOf": [ | ||
{ "type": ["string", "boolean", "null"] }, | ||
{ "not": { "enum": ["true", "false", "null"] } } |
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.
Since it's not obvious: the "true", "false" and "null" here merely disallow those strings, presumably to help highlight such mishaps in the editor. (The linter would also complain about it.)
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.
Yep. History of this is in #485.
"description": "A string or the value true, indicating which browser version removed this feature.", | ||
"allOf": [ | ||
{ "type": ["string", "boolean"] }, | ||
{ "not": { "enum": ["true", false] } } |
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 is not the most obvious way of saying that true is an allowed value, but convenient since the string "true" is already excluded here.
@ddbeck I've updated |
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.
A couple little suggestions on the wording of the descriptions, but nothing major. Also, I checked out this branch locally and confirmed that the schema changed worked as expected by seeing my editor correctly flag some now-invalid changes. 👍
"description": "A string the value true, indicating which browser version added this feature, or the value false indicating the feature is not supported, or the value null indicating support is unknown.", | ||
"allOf": [ | ||
{ "type": ["string", "boolean", "null"] }, | ||
{ "not": { "enum": ["true", "false", "null"] } } |
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.
Yep. History of this is in #485.
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
@ddbeck suggestions applied! |
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.
Thank you!
@Elchi3 this is a (what looks to me a non-breaking) schema change, so I thought I'd give you a chance to review it too. Though if you're not concerned about it, dismiss the review request and I'll go ahead. |
Given that the data and schema go together, what would constitute a breaking schema change? Since this change makes the schema stricter it should be breaking by some definition, but I'm not sure how in practice. |
This was my thinking: suppose we changed the data, but didn't change the schema. That wouldn't be breaking, though it would be the case that our data, at present, doesn't contain any But by changing the schema, we're saying to consumers, "you can safely discard any code that expects That said, if we wanted to play things safe, we could treat any schema change as breaking. |
Ah, right, the schema is our "API" and consumers can now make some more assumptions about the data, which is exactly why I made the change. I don't particularly mind which part of the version is bumped, but could see the argument for either minor or patch version. Bumping the minor version might bring more attention to the change, allowing more consumers to simplify their code. |
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.
Makes sense to me! We should have had this from this start :)
Semver minor sounds good to me, too.
Setting it explicitly to null or false is meaningless.