-
Notifications
You must be signed in to change notification settings - Fork 213
feat: add schemas/vspec-node.schema.json — machine-readable vspec node format #920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,61 @@ | ||||||
| { | ||||||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||||||
| "$id": "https://covesa.github.io/vehicle_signal_specification/schemas/vspec-node.schema.json", | ||||||
| "title": "VSS vspec node", | ||||||
| "description": "A single node in a VSS vspec YAML file.", | ||||||
| "type": "object", | ||||||
| "required": ["type"], | ||||||
| "properties": { | ||||||
| "type": { | ||||||
| "type": "string", | ||||||
| "enum": ["branch", "sensor", "actuator", "attribute"], | ||||||
| "description": "Node kind. branch = non-leaf container; sensor/actuator/attribute = leaf." | ||||||
| }, | ||||||
| "datatype": { | ||||||
| "type": "string", | ||||||
| "description": "Value type for leaf nodes, e.g. float, uint8, string, boolean. Required for sensor/actuator/attribute; not used on branch." | ||||||
| }, | ||||||
| "description": { | ||||||
| "type": "string", | ||||||
| "description": "Human-readable description of the signal or branch." | ||||||
| }, | ||||||
| "unit": { | ||||||
| "type": "string", | ||||||
| "description": "Unit of measure. Should be a value from the VSS unit catalogue (spec/units.yaml)." | ||||||
| }, | ||||||
| "min": { | ||||||
| "description": "Minimum valid value (numeric). Applies to leaf nodes only." | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. type |
||||||
| }, | ||||||
| "max": { | ||||||
| "description": "Maximum valid value (numeric). Applies to leaf nodes only." | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. number type |
||||||
| }, | ||||||
| "default": { | ||||||
| "description": "Default value for the signal at startup. Type must match datatype." | ||||||
| }, | ||||||
| "comment": { | ||||||
| "type": "string", | ||||||
| "description": "Informative note, not part of the normative definition." | ||||||
| }, | ||||||
| "deprecation": { | ||||||
| "type": "string", | ||||||
| "description": "Non-empty string indicates this node is deprecated; value is the deprecation notice including the version when it was deprecated." | ||||||
| }, | ||||||
| "instances": { | ||||||
| "description": "Instance expansion expression (string or array of strings) for parameterised branches.", | ||||||
| "oneOf": [ | ||||||
| { "type": "string" }, | ||||||
| { "type": "array", "items": { "type": "string" }, "minItems": 1 } | ||||||
| ] | ||||||
| }, | ||||||
| "allowed": { | ||||||
| "type": "array", | ||||||
| "description": "Enumerated allowed values for the signal. Items should match the datatype.", | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| "minItems": 1 | ||||||
| }, | ||||||
| "pattern": { | ||||||
| "type": "string", | ||||||
| "description": "Regular expression that the signal value must match." | ||||||
| } | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| }, | ||||||
| "additionalProperties": false | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know how easy it would be to create a minimal example on how this could be used, that we potentially could execute as part of CI to verify that std catalog and the schema are in sync. I am thinking of something
vspec export yamlorvspec export jsonHave you done any checks like that to verify that the schema works with the current std catalog?