Metamodel Schema Reference#
The S-CORE documentation metamodel is defined in a YAML file. It declares all Sphinx-Needs types (directives), their mandatory and optional options, link relationships, and validation rules used across S-CORE documentation repositories.
For details on the extension internals, validation checks, and how to add new need types, see the score_metamodel extension guide.
Schema#
Below is the JSON Schema that validates the structure of metamodel.yaml.
S-CORE Metamodel Schema#
https://eclipse-score.github.io/docs-as-code/metamodel-schema.json |
|||||
Validates the structure of metamodel.yaml, which defines all Sphinx-Needs types, their options, and link relationships used across S-CORE documentation. |
|||||
type |
object |
||||
properties |
|||||
|
Map of need type identifiers to their definitions. Each key becomes a Sphinx-Needs directive (e.g. |
||||
type |
object |
||||
additionalProperties |
Definition of a single need type. |
||||
type |
object |
||||
properties |
|||||
|
Human-readable display name shown in rendered documentation (e.g. ‘Feature Requirement’). |
||||
type |
string |
||||
|
ID prefix for auto-generated need IDs. Defaults to |
||||
type |
string |
||||
|
CSS color used when rendering this need type in diagrams and tables. |
||||
type |
string |
||||
|
Visual style hint for diagram rendering (e.g. Plantuml stereotype). |
||||
type |
string |
||||
|
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. |
||||
type |
object |
||||
additionalProperties |
type |
string |
|||
|
Options that may optionally appear on a need of this type. Validated against the regex pattern when present. |
||||
type |
object |
||||
additionalProperties |
type |
string |
|||
|
Link fields that every need of this type must include. Values are regex patterns restricting which target need IDs are allowed. |
||||
type |
object |
||||
additionalProperties |
type |
string |
|||
|
Link fields that may optionally appear. Values are regex patterns restricting allowed target need IDs. |
||||
type |
object |
||||
additionalProperties |
type |
string |
|||
|
Extra Sphinx-Needs link type definitions. Each key is the link option name used in directives (e.g. |
||||
type |
object |
||||
additionalProperties |
A bidirectional link type definition. |
||||
type |
object |
||||
properties |
|||||
|
Label shown on the target side of the link (e.g. ‘is implemented by’). |
||||
type |
string |
||||
|
Label shown on the source side of the link (e.g. ‘implements’). |
||||
type |
string |
||||
Quick example#
A minimal type definition in metamodel.yaml looks like this:
needs_types:
feat_req:
title: Feature Requirement
prefix: feat_req__
mandatory_options:
id: ^feat_req__[0-9a-z_]*$
status: ^(valid|draft)$
optional_links:
satisfies: ^std_req__.*$
tags:
- requirement
parts: 2
Each option value is a regex pattern that the corresponding field must match.
The parts key specifies how many segments (separated by __) the need ID contains.