Files
Cognitive_Agent/contracts/schemas/signal-mapping.schema.json
T
2026-07-30 08:45:38 +08:00

65 lines
2.8 KiB
JSON
Executable File

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cognitive-agent.local/schemas/signal-mapping.schema.json",
"title": "SignalMapping",
"type": "object",
"additionalProperties": false,
"required": ["apiVersion", "kind", "metadata", "spec"],
"properties": {
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
"kind": {"const": "SignalMapping"},
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
"spec": {
"type": "object",
"additionalProperties": false,
"required": ["domain", "platform", "dbc_ref", "status", "mappings"],
"properties": {
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
"platform": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
"dbc_ref": {"type": "string", "format": "uri-reference"},
"matrix_ref": {"type": "string", "format": "uri-reference"},
"status": {"type": "string", "enum": ["draft", "hil_verified", "vehicle_verified"]},
"mappings": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["capability", "parameter", "compiler_handler"],
"properties": {
"capability": {"type": "string", "pattern": "^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$"},
"parameter": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
"target_zone": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
"physical_target_alias": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
"compiler_handler": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
"bus": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
"message": {"type": "string", "minLength": 1},
"signal": {"type": "string", "minLength": 1},
"signals": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {"type": "string", "minLength": 1}
},
"value_map": {
"type": "object",
"minProperties": 1,
"additionalProperties": {"type": "integer"}
},
"feedback_message": {"type": "string", "minLength": 1},
"feedback_signal": {"type": "string", "minLength": 1},
"feedback_handler": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"},
"feedback_value_map": {
"type": "object",
"minProperties": 1,
"additionalProperties": {"type": "integer"}
},
"calibration_ref": {"type": "string", "format": "uri-reference"},
"unit": {"type": "string", "minLength": 1}
}
}
}
}
}
}
}