Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misalignment in Protobuf Specification with Updated XML and JSON Schemas for LicenseChoice #465

Closed
mtsfoni opened this issue May 12, 2024 · 6 comments · Fixed by #468
Closed

Comments

@mtsfoni
Copy link

mtsfoni commented May 12, 2024

Up to version 1.5, there was a discrepancy between the XML and the JSON Schema, which was resolved as per #204/#205. Since that update, LicenseChoice has become a complex type in the JSON formats to match the XML Schema. It is now defined to potentially include a list of licenses and an (optional) expression.

However, the corresponding protobuf specification was not updated to reflect these changes. As a result, the protobuf still retains the list of LicenseChoice as shown below:

message Component {
...
repeated LicenseChoice licenses = 13;
}

message LicenseChoice {
  oneof choice {
    License license = 1;
    // A valid SPDX license expression. Refer to https://spdx.org/specifications for syntax requirements
    string expression = 2;
  }
  // This field must only be used when "expression" is chosen as the License object has its own acknowledgement.
  optional LicenseAcknowledgementEnumeration acknowledgement = 3;
}
@jkowalleck
Copy link
Member

jkowalleck commented May 12, 2024

each schema is an implementation of the spec - with the goal to make it possible to model the specification with clear guidelines.

spec is:

EITHER (list of SPDX licenses and/or named licenses) OR (tuple of one SPDX License Expression)

In ProtoBuff we see

message LicenseChoice {
oneof choice {
License license = 1;
// A valid SPDX license expression. Refer to https://spdx.org/specifications for syntax requirements
string expression = 2;
}
// This field must only be used when "expression" is chosen as the License object has its own acknowledgement.
optional LicenseAcknowledgementEnumeration acknowledgement = 3;
}

where License license = 1; is currently not repeated,
but it should be repeated License license = 1;, to match the spec.
PS: read below: #465 (comment)

@jkowalleck
Copy link
Member

jkowalleck commented May 12, 2024

However, the corresponding protobuf specification was not updated to reflect these changes.

because it was correct, already.
spec says: EITHER (list of SPDX licenses and/or named licenses) OR (tuple of one SPDX License Expression)

You can build a structure with multiple licenses, as it is described by the CycloneDX spec.
see

repeated LicenseChoice licenses = 13;

multi license component here: https://github.com/CycloneDX/specification/blob/8e131b1688ccfe41e1bfdd4b3280f33dcc06d04c/tools/src/test/resources/1.6/valid-metadata-license-1.6.textproto

@andreas-hilti
Copy link
Contributor

@jkowalleck You can currently build everything that is expected, that is a list of licenses or a single license expression. However, you can also build a list of license expressions, which is not intended.

@jkowalleck
Copy link
Member

However, you can also build a list of license expressions, which is not intended.

I acknowledge a lack of documentation there. Will drop a PR to have it added.

jkowalleck added a commit to jkowalleck/fork_CycloneDX-specification that referenced this issue May 24, 2024
see CycloneDX#465

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck
Copy link
Member

please review #468

@jkowalleck
Copy link
Member

please also be aware of upcoming #454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants