-
-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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