Skip to content

Commit

Permalink
Require that version_removed is either a string or true (#9015)
Browse files Browse the repository at this point in the history
* Require that version_removed is either a string or true

Setting it explicitly to null or false is meaningless.

* Update the schema (splits version_added/version_removed)

* Update schemas/compat-data.schema.json

Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>

* Update schemas/compat-data.schema.json

Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>

Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
  • Loading branch information
foolip and ddbeck authored Mar 9, 2021
1 parent 2512c47 commit 9bc5f00
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
3 changes: 1 addition & 2 deletions http/headers/x-xss-protection.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"version_added": true
},
"samsunginternet_android": {
"version_added": true,
"version_removed": false
"version_added": true
},
"webview_android": {
"version_added": false
Expand Down
12 changes: 6 additions & 6 deletions schemas/compat-data-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,14 @@ entirely unknown. Examples:

#### `version_removed`

Contains a string with the version number the sub-feature was
removed in. It may also be a Boolean value of (`true` or `false`), or the
`null` value.
Contains a string with the version number the sub-feature was removed in.
It may also be `true`, meaning that it is unknown in which version support
was removed.

Default values:

- If `version_added` is set to `true`, `false`, or a string, `version_removed` defaults to `false`.
- if `version_added` is set to `null`, the default value of `version_removed` is also `null`.
- If `version_added` is set to `null`, the default value of `version_removed` is also `null`.

Examples:

Expand All @@ -237,12 +237,12 @@ Examples:
}
```

- Not removed (default if `version_added` is not `null`):
- Removed in some version after 3.5:

```json
{
"version_added": "3.5",
"version_removed": false
"version_removed": true
}
```

Expand Down
25 changes: 15 additions & 10 deletions schemas/compat-data.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,20 @@
"type": "boolean",
"description": "A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example)."
},
"version_added": { "$ref": "#/definitions/version_value" },
"version_removed": { "$ref": "#/definitions/version_value" },
"version_added": {
"description": "A string (indicating which browser version added this feature), the value true (indicating support added in an unknown version), 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"] } }
]
},
"version_removed": {
"description": "A string, indicating which browser version removed this feature, or the value true, indicating that the feature was removed in an unknown version.",
"allOf": [
{ "type": ["string", "boolean"] },
{ "not": { "enum": ["true", false] } }
]
},
"notes": {
"description": "A string or array of strings containing additional information.",
"anyOf": [
Expand All @@ -64,7 +76,7 @@
"required": ["version_added"],
"anyOf": [
{
"not": {"required": ["prefix","alternative_name"]}
"not": {"required": ["prefix", "alternative_name"]}
},
{
"oneOf": [
Expand Down Expand Up @@ -258,13 +270,6 @@
"^(?!__compat)[a-zA-Z_0-9-$@]*$" : { "$ref": "#/definitions/webextensions_identifier" }
},
"additionalProperties": false
},

"version_value": {
"allOf": [
{ "type": ["string", "boolean", "null"] },
{ "not": { "enum": ["true", "false", "null"] } }
]
}
},

Expand Down

0 comments on commit 9bc5f00

Please sign in to comment.