generated from tier4/ros2-project-template
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(json-schema): add schema templates
Signed-off-by: amadeuszsz <[email protected]>
- Loading branch information
1 parent
cbd52ea
commit 39410ab
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "<sensor_type> <sensor_vendor> <sensor_model> parameters.", | ||
"type": "object", | ||
"definitions": { | ||
"<sensor_model>": { | ||
"type": "object", | ||
"properties": { | ||
"example_parameter_1": { | ||
"$ref": "sub/communication.json#/definitions/example_parameter_1" | ||
}, | ||
"example_parameter_2": { | ||
"$ref": "sub/communication.json#/definitions/example_parameter_2" | ||
}, | ||
"example_parameter_3": { | ||
"$ref": "sub/hardware.json#/definitions/example_parameter_3" | ||
}, | ||
"example_parameter_4": { | ||
"$ref": "sub/topic.json#/definitions/example_parameter_4" | ||
}, | ||
"example_parameter_5": { | ||
"$ref": "sub/misc.json#/definitions/example_parameter_5" | ||
}, | ||
"example_parameter_6": { | ||
"$ref": "sub/<sensor_type>_<vendor>.json#/definitions/example_parameter_6" | ||
} | ||
}, | ||
"required": [ | ||
"example_parameter_1", | ||
"example_parameter_2", | ||
"example_parameter_3", | ||
"example_parameter_4", | ||
"example_parameter_5", | ||
"example_parameter_6" | ||
], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"properties": { | ||
"/**": { | ||
"type": "object", | ||
"properties": { | ||
"ros__parameters": { | ||
"$ref": "#/definitions/<sensor_model>" | ||
} | ||
}, | ||
"required": ["ros__parameters"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["/**"], | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "<sensor_type> <sensor_vendor> parameters.", | ||
"type": "object", | ||
"definitions": { | ||
"sensor_model": { | ||
"$ref": "hardware.json#/definitions/sensor_model", | ||
"enum": [ | ||
"<sensor_model_1>", | ||
"<sensor_model_2>" | ||
] | ||
}, | ||
"example_parameter_1": { | ||
"type": "integer", | ||
"default": 42, | ||
"readOnly": true, | ||
"description": "Exclusive parameter only for specific sensor vendor." | ||
}, | ||
"example_parameter_2": { | ||
"$ref": "communication.json#/definitions/example_parameter_2", | ||
"maximum": 100, | ||
"$comment": "Shared parameter, but needs some changes only for this sensor vendor." | ||
}, | ||
"example_parameter_3": { | ||
"$ref": "hardware.json#/definitions/example_parameter_3", | ||
"$comment": "Wrong! If no changes declare parameter in schema/<sensor_model>.schema.json." | ||
} | ||
} | ||
} |