Skip to content

Protobuf: Evidence.identity is repeated, but should be optional #272

Closed

Description

@nscuro

The identity field of Evidence is repeated in the current v1.5 Protobuf schema, whereas it is a singular object in the JSON and XML variants of the schema.

message Evidence {
repeated LicenseChoice licenses = 1;
repeated EvidenceCopyright copyright = 2;
repeated EvidenceIdentity identity = 3;
repeated EvidenceOccurrences occurrences = 4;
optional Callstack callstack = 5;
}

"componentEvidence": {
"type": "object",
"title": "Evidence",
"description": "Provides the ability to document evidence collected through various forms of extraction or analysis.",
"additionalProperties": false,
"properties": {
"identity": {
"type": "object",
"description": "Evidence that substantiates the identity of a component.",
"required": [ "field" ],
"additionalProperties": false,
"properties": {

<xs:complexType name="componentEvidenceType">
<xs:sequence>
<xs:element name="identity" minOccurs="0" maxOccurs="1">

As the field is not required, it should be optional.

Activity

  1. added this to the 1.6 milestone on Dec 9, 2023
  2. prabhu commented on Dec 24, 2023

    @prabhu
    Contributor

    Am I correct in assuming that even Evidence must be optional as shown in the below commit?

    cdxgen/cdx-proto@3b57244?diff=split&w=1#diff-8dd4e24a6bce8169f7ec43877352e1f85f2c5cf66b8f0733b1957c7f540e6861

    I think in 1.6, we need to add some conformance tests where we serialize using proto and then attempt to deserialize and read as json and vice versa.

  3. stevespringett commented on Dec 27, 2023

    @stevespringett
    Member

    Actually, the defect is in the JSON and XML schemas. In this case, the protobuf is correct. Identity should be an array.

  4. stevespringett commented on Dec 27, 2023

    @stevespringett
    Member

    I think in 1.6, we need to add some conformance tests where we serialize using proto and then attempt to deserialize and read as json and vice versa.

    I think there's some tests that are performed in .NET. Perhaps @coderpatros can shed some light.

  5. prabhu commented on Dec 27, 2023

    @prabhu
    Contributor

    Actually, the defect is in the JSON and XML schemas. In this case, the protobuf is correct. Identity should be an array.

    This would be a large breaking change for cdxgen and depscan users since the identity object is used quite heavily

  6. stevespringett commented on Dec 28, 2023

    @stevespringett
    Member

    This would be a large breaking change for cdxgen and depscan users since the identity object is used quite heavily

    How would this be a breaking change? The unit tests, which incorporate both single object and arrays, are passing validation. There will be no changes required in cdxgen or depscan, although the current method (single object) has been deprecated. So implementations will be encouraged to update to supporting arrays. But no functionality is breaking.

  7. added a commit that references this issue on Jan 16, 2024
    63e48c4
  8. stevespringett commented on Jan 16, 2024

    @stevespringett
    Member

    Fix will be included in v1.6

  9. added a commit that references this issue on Apr 9, 2024
  10. added a commit that references this issue on Jan 27, 2026
  11. added 2 commits that reference this issue on Feb 23, 2026
    d248e84
    1d5c493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions