Skip to content

Commit c52d062

Browse files
committed
Add schema for AddonCatalog JSON file
1 parent 85bfb91 commit c52d062

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

AddonCatalog.schema.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "AddonCatalog",
4+
"description": "A catalog of addons indexed by addon ID. Each ID maps to a list of AddonCatalogEntry objects.",
5+
"type": "object",
6+
"patternProperties": {
7+
"^.+$": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"freecad_min": {
13+
"type": "string",
14+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-[\\da-zA-Z\\-.]+)?(?:\\+[\\da-zA-Z\\-.]+)?$",
15+
"description": "Minimum compatible FreeCAD version (inclusive, Semantic Versioning)"
16+
},
17+
"freecad_max": {
18+
"type": "string",
19+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-[\\da-zA-Z\\-.]+)?(?:\\+[\\da-zA-Z\\-.]+)?$",
20+
"description": "Maximum compatible FreeCAD version (inclusive, Semantic Versioning)"
21+
},
22+
"repository": {
23+
"type": "string",
24+
"format": "uri",
25+
"description": "Git repository URL"
26+
},
27+
"git_ref": {
28+
"type": "string",
29+
"description": "Git reference (e.g. SHA, branch, or tag)"
30+
},
31+
"zip_url": {
32+
"type": "string",
33+
"format": "uri",
34+
"description": "Direct download link for a .zip file. If git information is also present, this should correspond to a ZIP download link that will result in the same code as a checkout of the given git repo and ref."
35+
},
36+
"note": {
37+
"type": "string",
38+
"description": "Notes about this addon version. Not displayed, only for reference in the JSON catalog file."
39+
},
40+
"branch_display_name": {
41+
"type": "string",
42+
"description": "Display name for the addon version branch. If omitted, the git ref is used."
43+
}
44+
},
45+
"anyOf": [
46+
{
47+
"required": ["repository", "git_ref"]
48+
},
49+
{
50+
"required": ["zip_url"]
51+
}
52+
],
53+
"if": {
54+
"not": {
55+
"required": ["git_ref"]
56+
}
57+
},
58+
"then": {
59+
"required": ["branch_display_name"]
60+
},
61+
"additionalProperties": false
62+
}
63+
}
64+
},
65+
"additionalProperties": false
66+
}

0 commit comments

Comments
 (0)