open-component-model / ocm

Open Component Model (Software Bill of Delivery) Toolset
https://ocm.software
Apache License 2.0
34 stars 23 forks source link

fix field name for srcRefs #651

Closed mandelsoft closed 8 months ago

mandelsoft commented 8 months ago

Description

There is an inconsistency between the json schemas and the json field names for the component descriptor versions. The original spec as well as the schemas use the name srcRefs for the list of source references in am entry of the resource list.

In the ocm code base the field name srcRef is used for the Go structs as well as the json annotation.

Unfortunately the scheme allows for additional fields, therefore the mismatch never provided an error.

Therefore it might have happened, that wrong component descriptors using the singular form have been created.

Because of the differentiation of the internal and external representation it is easily possible to accept both versions for deserialization, but the serialization provides only the correct form, now.

What type of PR is this? (check all applicable)

Related Tickets & Documents

Screenshots

Added tests?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

Checklist: