Repository navigation
[2.0] refactor component for specificcomponent types #1024
Copy link
Copy link
Open
Labels
CDX 2.0related to release v2.0related to release v2.0
Milestone
Description
after
the current component should be split in
baseComponent- core properties of a componentserviceComponent- inherit frombaseComponentand add service-specific properties and requirementssoftwareComponent- inherit frombaseComponentand add {application,framework,library,...}-specific properties and requirementshardwareComponent- inherit frombaseComponentand add service-specific properties and requirementsfileComponent- inherit frombaseComponentand add file-specific properties and requirementsdataComponent- inherit frombaseComponentand add data-specific properties and requirements- ... and so on - for each component type
I would even put the baseComponent, serviceComponent, etc ... under /$defs/component/$defs/,
not under /$defs/
after that split, the current component becomes a oneOf ala
{
"$defs": {
"component" : {
"oneOf": [
{"$ref": "#$defs/component/$defs/serviceComponent"}
{"$ref": "#$defs/component/$defs/hardwareComponent"},
{"$ref": "#$defs/component/$defs/...Component"},
],
"$defs": {
"baseComponent": {
"$comment": "This is a mixin. make sure to use `unevaluatedProperties` in the usage downstream"
"type": "object",
"required": [ ... ]
"properties": {
"type": { "enum": ["service", "device", ...] },
"bom-ref": ...,
"parties": ...
"group": ...,
"name": ...,
"description": ...,
"version": ...,
"versionRange": ...,
"isExternal": ...,
...
"components": { "$ref": "#$defs/components" }
}
},
"serviceComponent": {
"allOf": [{ "$ref": "#/$defs/component/$defs/baseComponent" }],
"titile": "Service Component",
"type": "object",
"required": ["endpoint", ...]
"properties": {
"type": { "enum": ["service"] },
// service-specific properties
"endpoint": ...,
"isExternal": { "default": true },
...
"components": { "$comment": "opportunity: make all items requiring a certain `type`" }
},
"unevaluatedProperties": false
},
"...Component": { ... },
}
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CDX 2.0related to release v2.0related to release v2.0
Activity
[-][2.0] refactor component[/-][+][2.0] refactor component for specificcomponent types[/+]