Skip to content

Missing required fields cause null access errors #218

@dlg1206

Description

@dlg1206

https://github.com/SoftwareDesignLab/SVIP/blob/b24c129a19f1e42aa75a24f0b8fcc4a4decc18c8/core/src/main/java/org/svip/sbom/builder/objects/SVIPSBOMBuilder.java#L149-L167

There are numerous null checks throughout SVIP since technically all fields are optional. We should require the builders to be instantiated with required fields for that schema, ie

// just example, may be missing addtional fields
var cdxB = new CDXComponentBuilder(name, type, ...);
var spdxB = new SPDXPackageBuilder(name, spdxid, ...);

This way required fields like names aren't null and add non-required, additional information via the .set and .add methods in the builder.

Resources

Acceptance Criteria

  • Identify required fields for each schema

Existing list can be found here

  • Update builders with required fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions