1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "$id": "https://variants-schema.wheelnext.dev/peps/9999/v0.2.0.json",
4 "title": "Variant metadata, v0.2.0",
5 "description": "The format for variant metadata (variant.json) and index-level metadata ({name}-{version}-variants.json)",
6 "type": "object",
7 "properties": {
8 "$schema": {
9 "description": "JSON schema URL",
10 "type": "string"
11 },
12 "default-priorities": {
13 "description": "Default priorities for ordering variants",
14 "type": "object",
15 "properties": {
16 "namespace": {
17 "description": "Namespaces (in order of preference)",
18 "type": "array",
19 "items": {
20 "type": "string",
21 "pattern": "^[a-z0-9_]+$"
22 },
23 "minItems": 1,
24 "uniqueItems": true
25 }
26 },
27 "additionalProperties": false,
28 "required": [
29 "namespace"
30 ]
31 },
32 "providers": {
33 "description": "Mapping of namespaces to provider information",
34 "type": "object",
35 "patternProperties": {
36 "^[A-Za-z0-9_]+$": {
37 "type": "object",
38 "description": "Provider information",
39 "properties": {
40 "plugin-api": {
41 "description": "Object reference to plugin class",
42 "type": "string",
43 "pattern": "^([a-zA-Z0-9._]+ *: *[a-zA-Z0-9._]+)|([a-zA-Z0-9._]+)$"
44 },
45 "optional": {
46 "description": "Whether the provider is optional (disabled by default)",
47 "type": "boolean"
48 },
49 "requires": {
50 "description": "Dependency specifiers for how to install the plugin",
51 "type": "array",
52 "items": {
53 "type": "string",
54 "minLength": 1
55 },
56 "minItems": 0,
57 "uniqueItems": true
58 },
59 "static-properties": {
60 "description": "Static properties (by feature name)",
61 "type": "object",
62 "patternProperties": {
63 "^[a-z0-9_]+$": {
64 "description": "Ordered value list",
65 "type": "array",
66 "items": {
67 "type": "string",
68 "pattern": "^[a-z0-9_.]+$"
69 },
70 "minItems": 0,
71 "uniqueItems": true
72 },
73 "additionalProperties": false
74 }
75 }
76 },
77 "additionalProperties": false,
78 "anyOf": [
79 {"required": ["requires"]},
80 {"required": ["static-properties"]}
81 ]
82 }
83 },
84 "additionalProperties": false
85 },
86 "variants": {
87 "description": "Mapping of variant labels to properties",
88 "type": "object",
89 "patternProperties": {
90 "^[a-z0-9_.]+$": {
91 "type": "object",
92 "description": "Mapping of namespaces in a variant",
93 "patternProperties": {
94 "^[a-z0-9_]+$": {
95 "description": "Mapping of feature names in a namespace",
96 "type": "object",
97 "patternProperties": {
98 "^[a-z0-9_]+$": {
99 "description": "List of values for this variant feature",
100 "type": "array",
101 "items": {
102 "type": "string",
103 "pattern": "^[a-z0-9_.]+$"
104 },
105 "minItems": 1,
106 "uniqueItems": true
107 }
108 },
109 "additionalProperties": false
110 }
111 },
112 "additionalProperties": false
113 }
114 },
115 "additionalProperties": false
116 }
117 },
118 "required": [
119 "$schema",
120 "default-priorities",
121 "providers",
122 "variants"
123 ],
124 "additionalProperties": false
125}