Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[2.0] refactor component for specificcomponent types

Aperta
#1,024 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
json
Ambito
data

Direzione di ricerca

Inizia con le due pull request di specifica collegate e individua la definizione attuale del componente. Traccia come vengono utilizzati i riferimenti ai componenti e i requisiti specifici del tipo. Il lavoro è completato quando il componente è suddiviso in definizioni di base e specifiche del tipo, i tipi di componente supportati sono rappresentati tramite oneOf e la gestione a valle delle proprietà rimane esplicita.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

CDX 2.0

after

the current component should be split in

  • baseComponent - core properties of a component
  • serviceComponent - inherit from baseComponent and add service-specific properties and requirements
  • softwareComponent - inherit from baseComponent and add {application,framework,library,...}-specific properties and requirements
  • hardwareComponent - inherit from baseComponent and add service-specific properties and requirements
  • fileComponent - inherit from baseComponent and add file-specific properties and requirements
  • dataComponent - inherit from baseComponent and 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": { ... },
       } 
    }
  }


}
Lingua principale
XSLT
Stelle
551
Fork
93
Merge medio
4h 51m
PR unite (30g)
42

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CycloneDX/specification

Tutte le issue di CycloneDX/specification

Issue simili

Altre issue su Data Engineering

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.