Skip to content

slacken Bom.serialNumber in data models #588

@jkowalleck

Description

@jkowalleck

Currently, the Bom data model's setter of serialNumber asserts a certain format.
This format is the one from JSON schema. This format is also allowed via XSD.
Unfortunately, there is an alternative format allowed in the XSD.

Currently, the normalizer will normalize any serialNumber.
But according to the schema, it must follow a certain format.

Therefore, the format must not be checked in the setter, but asserted by the normalizer.
Invalid serial numbers should be omitted on normalization, but are allowed in the model.

Additionally, it might help if a serialNumber generator was provided by the library.
Luckily, this was already done here:
see https://github.com/CycloneDX/cyclonedx-node-npm/blob/54de64bec1642c8c0ab12f36810eab6d1a5f5489/src/builders.ts#L488-L502

Metadata

Metadata

Assignees

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