Skip to content

Commit ac5685b

Browse files
committed
Add self-documentation to the catalog schema
1 parent c52d062 commit ac5685b

File tree

1 file changed

+40
-18
lines changed

1 file changed

+40
-18
lines changed

AddonCatalog.schema.json

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
"title": "AddonCatalog",
44
"description": "A catalog of addons indexed by addon ID. Each ID maps to a list of AddonCatalogEntry objects.",
55
"type": "object",
6+
"properties": {
7+
"$schema": {
8+
"type": "string",
9+
"format": "uri",
10+
"description": "A link to the JSON Schema describing the structure of this file."
11+
},
12+
"_meta": {
13+
"type": "object",
14+
"description": "Metadata describing the catalog file itself.",
15+
"properties": {
16+
"description": {
17+
"type": "string"
18+
},
19+
"schema_version": {
20+
"type": "string"
21+
}
22+
},
23+
"additionalProperties": true
24+
}
25+
},
626
"patternProperties": {
727
"^.+$": {
828
"type": "array",
@@ -11,52 +31,54 @@
1131
"properties": {
1232
"freecad_min": {
1333
"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)"
34+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-[\\da-zA-Z\\-.]+)?(?:\\+[\\da-zA-Z\\-.]+)?$"
1635
},
1736
"freecad_max": {
1837
"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)"
38+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-[\\da-zA-Z\\-.]+)?(?:\\+[\\da-zA-Z\\-.]+)?$"
2139
},
2240
"repository": {
2341
"type": "string",
24-
"format": "uri",
25-
"description": "Git repository URL"
42+
"format": "uri"
2643
},
2744
"git_ref": {
28-
"type": "string",
29-
"description": "Git reference (e.g. SHA, branch, or tag)"
45+
"type": "string"
3046
},
3147
"zip_url": {
3248
"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."
49+
"format": "uri"
3550
},
3651
"note": {
37-
"type": "string",
38-
"description": "Notes about this addon version. Not displayed, only for reference in the JSON catalog file."
52+
"type": "string"
3953
},
4054
"branch_display_name": {
41-
"type": "string",
42-
"description": "Display name for the addon version branch. If omitted, the git ref is used."
55+
"type": "string"
4356
}
4457
},
4558
"anyOf": [
4659
{
47-
"required": ["repository", "git_ref"]
60+
"required": [
61+
"repository",
62+
"git_ref"
63+
]
4864
},
4965
{
50-
"required": ["zip_url"]
66+
"required": [
67+
"zip_url"
68+
]
5169
}
5270
],
5371
"if": {
5472
"not": {
55-
"required": ["git_ref"]
73+
"required": [
74+
"git_ref"
75+
]
5676
}
5777
},
5878
"then": {
59-
"required": ["branch_display_name"]
79+
"required": [
80+
"branch_display_name"
81+
]
6082
},
6183
"additionalProperties": false
6284
}

0 commit comments

Comments
 (0)