|
1 | 1 | { |
2 | 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
3 | | - "$id": "https://example.com/metamodel-schema.json", |
| 3 | + "$id": "https://eclipse-score.github.io/docs-as-code/metamodel-schema.json", |
4 | 4 | "title": "S-CORE Metamodel Schema", |
| 5 | + "description": "Validates the structure of metamodel.yaml, which defines all Sphinx-Needs types, their options, and link relationships used across S-CORE documentation.", |
5 | 6 | "type": "object", |
6 | 7 | "properties": { |
7 | 8 | "types": { |
8 | 9 | "type": "object", |
9 | | - "description": "All Sphinx-Needs types (directives)", |
| 10 | + "description": "Map of need type identifiers to their definitions. Each key becomes a Sphinx-Needs directive (e.g. ``feat_req``, ``comp_arc_sta``).", |
10 | 11 | "additionalProperties": { |
11 | 12 | "type": "object", |
| 13 | + "description": "Definition of a single need type.", |
12 | 14 | "properties": { |
13 | | - "title": { "type": "string" }, |
14 | | - "prefix": { "type": "string" }, |
15 | | - "color": { "type": "string" }, |
16 | | - "style": { "type": "string" }, |
| 15 | + "title": { |
| 16 | + "type": "string", |
| 17 | + "description": "Human-readable display name shown in rendered documentation (e.g. 'Feature Requirement')." |
| 18 | + }, |
| 19 | + "prefix": { |
| 20 | + "type": "string", |
| 21 | + "description": "ID prefix for auto-generated need IDs. Defaults to ``<type_name>__`` when omitted." |
| 22 | + }, |
| 23 | + "color": { |
| 24 | + "type": "string", |
| 25 | + "description": "CSS color used when rendering this need type in diagrams and tables." |
| 26 | + }, |
| 27 | + "style": { |
| 28 | + "type": "string", |
| 29 | + "description": "Visual style hint for diagram rendering (e.g. Plantuml stereotype)." |
| 30 | + }, |
17 | 31 | "mandatory_options": { |
18 | 32 | "type": "object", |
19 | | - "description": "Map of field_name -> regex pattern (these fields are required).", |
20 | | - "additionalProperties": { "type": "string" } |
| 33 | + "description": "Options that every need of this type must provide. Each key is a field name and its value is a regex pattern the field value must match.", |
| 34 | + "additionalProperties": { |
| 35 | + "type": "string" |
| 36 | + } |
21 | 37 | }, |
22 | 38 | "optional_options": { |
23 | 39 | "type": "object", |
24 | | - "description": "Map of field_name -> regex pattern (these fields are optional).", |
25 | | - "additionalProperties": { "type": "string" } |
| 40 | + "description": "Options that may optionally appear on a need of this type. Validated against the regex pattern when present.", |
| 41 | + "additionalProperties": { |
| 42 | + "type": "string" |
| 43 | + } |
26 | 44 | }, |
27 | 45 | "mandatory_links": { |
28 | 46 | "type": "object", |
29 | | - "description": "Map of link_field_name -> regex pattern (these link fields are required).", |
30 | | - "additionalProperties": { "type": "string" } |
| 47 | + "description": "Link fields that every need of this type must include. Values are regex patterns restricting which target need IDs are allowed.", |
| 48 | + "additionalProperties": { |
| 49 | + "type": "string" |
| 50 | + } |
31 | 51 | }, |
32 | 52 | "optional_links": { |
33 | 53 | "type": "object", |
34 | | - "description": "Map of link_field_name -> regex pattern (these link fields are optional).", |
35 | | - "additionalProperties": { "type": "string" } |
| 54 | + "description": "Link fields that may optionally appear. Values are regex patterns restricting allowed target need IDs.", |
| 55 | + "additionalProperties": { |
| 56 | + "type": "string" |
| 57 | + } |
36 | 58 | } |
37 | 59 | }, |
38 | | - "required": ["title", "prefix", "mandatory_options"] |
| 60 | + "required": [ |
| 61 | + "title", |
| 62 | + "prefix", |
| 63 | + "mandatory_options" |
| 64 | + ] |
39 | 65 | } |
40 | 66 | }, |
41 | 67 | "links": { |
42 | 68 | "type": "object", |
43 | | - "description": "All extra link definitions. Key is the link 'option' name.", |
| 69 | + "description": "Extra Sphinx-Needs link type definitions. Each key is the link option name used in directives (e.g. ``implements``, ``satisfies``).", |
44 | 70 | "additionalProperties": { |
45 | 71 | "type": "object", |
| 72 | + "description": "A bidirectional link type definition.", |
46 | 73 | "properties": { |
47 | | - "incoming": { "type": "string" }, |
48 | | - "outgoing": { "type": "string" } |
| 74 | + "incoming": { |
| 75 | + "type": "string", |
| 76 | + "description": "Label shown on the target side of the link (e.g. 'is implemented by')." |
| 77 | + }, |
| 78 | + "outgoing": { |
| 79 | + "type": "string", |
| 80 | + "description": "Label shown on the source side of the link (e.g. 'implements')." |
| 81 | + } |
49 | 82 | }, |
50 | | - "required": ["incoming", "outgoing"] |
| 83 | + "required": [ |
| 84 | + "incoming", |
| 85 | + "outgoing" |
| 86 | + ] |
51 | 87 | } |
52 | 88 | } |
53 | 89 | }, |
54 | | - "required": ["types", "links"] |
55 | | - } |
| 90 | + "required": [ |
| 91 | + "types", |
| 92 | + "links" |
| 93 | + ] |
| 94 | +} |
0 commit comments