[2.0] refactor component for specificcomponent types
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- json
- Domain
- data
Research direction
Begin with the two linked specification pull requests and locate the current component definition. Trace how component references and type-specific requirements are used. Done means the component is split into base and type-specific definitions, the supported component types are represented by oneOf, and downstream property handling remains explicit.
Written by the indexing model from the issue text.
Description
after
- https://github.com/CycloneDX/specification/pull/982
- https://github.com/CycloneDX/specification/pull/975
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": { ... },
}
}
}
}
- Dominant language
- XSLT
- Stars
- 551
- Forks
- 93
- Avg merge
- 4h 51m
- Merged PRs (30d)
- 42
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CycloneDX/specification
-
Response vs Responce Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100
CycloneDX/specification#1121 ·
-
defect documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CycloneDX/specification#1115 ·
-
cap: cryptography-registry
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CycloneDX/specification#1098 ·
-
defect
Difficulty 1/5 Under an hour Newbie friendliness 91/100
CycloneDX/specification#1045 · 2 comments ·
-
CDX 2.0 documentation ready for review
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
CycloneDX/specification#1035 ·
All issues in CycloneDX/specification
Similar issues
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fivetran/great_expectations#12253 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 78/100
acl-org/acl-anthology#10071 · 1 comment ·
-
data:css needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mdn/browser-compat-data#30618 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
basedosdados/pipelines#2095 ·