Skip to content

Commit 292e445

Browse files
jcscottiiiddbeck
andauthored
Add type to alternatives in JSONSchema (#2697)
Currently, the alternatives field is described to be an array. But the type of item is missing. This change adds the type as string for each alternative. See-also: #2722 Co-authored-by: Daniel D. Beck <[email protected]>
1 parent 0413263 commit 292e445

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

schemas/data.schema.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
},
7171
"alternatives": {
7272
"description": "IDs for features that substitute some or all of this feature's utility",
73-
"items": {},
73+
"items": {
74+
"type": "string"
75+
},
7476
"type": "array"
7577
}
7678
},

types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ interface Discouraged {
7575
/** Links to a formal discouragement notice, such as specification text, intent-to-unship, etc. */
7676
according_to: string[];
7777
/** IDs for features that substitute some or all of this feature's utility */
78-
alternatives?: (keyof WebFeaturesData["features"])[];
78+
alternatives?: string[];
79+
// TODO: alternatives ought to be `(keyof WebFeaturesData["features"])[]`
80+
// but ts-json-schema-generator seems to have long-standing unresolved bugs
81+
// around this. Remove this when
82+
// https://github.com/web-platform-dx/web-features/issues/2722 is resolved.
7983
}
8084

8185
export interface GroupData {

0 commit comments

Comments
 (0)