1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://wheelnext.dev/schema/variant-0.0.1.json",
4 "title": "Variant metadata, v0.0.1",
5 "description": "The format for variant metadata (variant.json) and index-level metadata ({name}-{version}-variants.json)",
6 "type": "object",
7 "properties": {
8 "default-priorities": {
9 "description": "Default priorities for ordering variants",
10 "type": "object",
11 "properties": {
12 "namespace": {
13 "description": "Namespaces (in order of preference)",
14 "type": "array",
15 "items": {
16 "type": "string",
17 "pattern": "^[a-z0-9_]+$"
18 },
19 "minItems": 1,
20 "uniqueItems": true
21 },
22 "feature": {
23 "description": "Default feature priorities (by namespace)",
24 "type": "object",
25 "patternProperties": {
26 "^[a-z0-9_]+$": {
27 "description": "The most preferred features",
28 "type": "array",
29 "items": {
30 "type": "string",
31 "pattern": "^[a-z0-9_]+$"
32 },
33 "minItems": 0,
34 "uniqueItems": true
35 }
36 },
37 "additionalProperties": false,
38 "uniqueItems": true
39 },
40 "property": {
41 "description": "Default property priorities (by namespace)",
42 "type": "object",
43 "patternProperties": {
44 "^[a-z0-9_]+$": {
45 "description": "Default property priorities (by feature name)",
46 "type": "object",
47 "patternProperties": {
48 "^[a-z0-9_]+$": {
49 "description": "The most preferred feature values",
50 "type": "array",
51 "items": {
52 "type": "string",
53 "pattern": "^[a-z0-9_.]+$"
54 },
55 "minItems": 0,
56 "uniqueItems": true
57 }
58 },
59 "additionalProperties": false,
60 "uniqueItems": true
61 }
62 },
63 "additionalProperties": false,
64 "uniqueItems": true
65 }
66 },
67 "additionalProperties": false,
68 "uniqueItems": true,
69 "required": [
70 "namespace"
71 ]
72 },
73 "variants": {
74 "description": "Mapping of variant labels to properties",
75 "type": "object",
76 "patternProperties": {
77 "^[a-z0-9_.]{1,16}$": {
78 "type": "object",
79 "description": "Mapping of namespaces in a variant",
80 "patternProperties": {
81 "^[a-z0-9_.]+$": {
82 "description": "Mapping of feature names in a namespace",
83 "patternProperties": {
84 "^[a-z0-9_.]+$": {
85 "description": "List of values for this variant feature",
86 "type": "array",
87 "items": {
88 "type": "string",
89 "pattern": "^[a-z0-9_.]+$"
90 },
91 "minItems": 1,
92 "uniqueItems": true
93 }
94 },
95 "uniqueItems": true,
96 "additionalProperties": false
97 }
98 },
99 "uniqueItems": true,
100 "additionalProperties": false
101 }
102 },
103 "additionalProperties": false,
104 "uniqueItems": true
105 }
106 },
107 "required": [
108 "default-priorities",
109 "variants"
110 ],
111 "additionalProperties": false,
112 "uniqueItems": true
113}