Skip to content

Commit 24ff70a

Browse files
committed
GH-176 - Add jMolecules stereotypes schema.
1 parent 0e1bf9d commit 24ff70a

File tree

3 files changed

+123
-0
lines changed

3 files changed

+123
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://json.schemastore.org/schema-catalog.json",
3+
"version": 1,
4+
"schemas": [
5+
{
6+
"name": "jMolecules Stereotype Groups Schema",
7+
"description": "Schema to define jMolecules stereotype groups",
8+
"fileMatch": [
9+
"jmolecules-stereotype-groups.json",
10+
"**/jmolecules-stereotype-groups.json"
11+
],
12+
"url": "https://schemas.jmolecules.org/jmolecules-stereotype-groups.schema.json"
13+
},
14+
{
15+
"name": "jMolecules Stereotypes Schema",
16+
"description": "Schema to define jMolecules stereotypes",
17+
"fileMatch": [
18+
"jmolecules-stereotypes.json",
19+
"**/jmolecules-stereotypes.json"
20+
],
21+
"url": "https://schemas.jmolecules.org/jmolecules-stereotypes.schema.json"
22+
}
23+
]
24+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://schemas.jmolecules.org/jmolecules-groups.schema.json",
4+
"type": "object",
5+
"description": "Configuration for jMolecules stereotype groups",
6+
"required": ["groups"],
7+
"properties": {
8+
"groups": {
9+
"type": "object",
10+
"description": "Group definitions that stereotypes can belong to",
11+
"patternProperties": {
12+
"^@?[\\w.-]+$": {
13+
"type": "object",
14+
"required": ["displayName"],
15+
"properties": {
16+
"displayName": {
17+
"type": "string",
18+
"minLength": 1,
19+
"description": "Human-readable name for the group"
20+
},
21+
"priority": {
22+
"type": "integer",
23+
"minimum": 0,
24+
"default": 0,
25+
"description": "Processing priority of the group, defaults to 0"
26+
},
27+
"type": {
28+
"type": "string",
29+
"enum": [ "architecture", "design", "technical" ],
30+
"default": "technical",
31+
"description": "Type category of the group"
32+
}
33+
},
34+
"additionalProperties": false
35+
}
36+
}
37+
}
38+
},
39+
"additionalProperties": false
40+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://schemas.jmolecules.org/jmolecules-stereotypes.schema.json",
4+
"type": "object",
5+
"description": "Configuration for jMolecules stereotypes",
6+
"required": ["stereotypes"],
7+
"properties": {
8+
"stereotypes": {
9+
"type": "object",
10+
"description": "List of stereotype definitions that can be applied to code elements",
11+
"patternProperties": {
12+
"^@?[\\w.-]+$": {
13+
"type": "object",
14+
"required": ["assignments", "groups"],
15+
"properties": {
16+
"displayName": {
17+
"type": "string",
18+
"minLength": 1,
19+
"description": "Human-readable name for the stereotype (optional)"
20+
},
21+
"assignments": {
22+
"type": "array",
23+
"description": "List of type or annotation assignments that this stereotype can be applied to",
24+
"items": {
25+
"type": "string",
26+
"pattern": "^@?[\\w.-]+$",
27+
"description": "Type or annotation identifier, optionally prefixed with @ for annotations"
28+
},
29+
"minItems": 1,
30+
"uniqueItems": true
31+
},
32+
"groups": {
33+
"type": "array",
34+
"description": "Groups that this stereotype belongs to",
35+
"items": {
36+
"type": "string",
37+
"pattern": "^[\\w.-]+$",
38+
"description": "Group identifier using dot notation"
39+
},
40+
"minItems": 1,
41+
"uniqueItems": true
42+
},
43+
"priority": {
44+
"type": "integer",
45+
"minimum": 0,
46+
"default": 0,
47+
"description": "Processing priority of the stereotype, defaults to 0"
48+
}
49+
}
50+
}
51+
},
52+
"additionalProperties": false
53+
},
54+
"groups": {
55+
"$ref": "https://schemas.jmolecules.org/jmolecules-stereotype-groups.schema.json#/properties/groups"
56+
}
57+
},
58+
"additionalProperties": false
59+
}

0 commit comments

Comments
 (0)