[ISSUE-196] Fix JSON schema inconsistency
Fixes #196
Changes made in this PR:
~~1. fix type array to object since Data is of type pointer to ComponentData~~
Thanks for the PR @jameskim0987! Unfortunately it's the opposite of what needs to be done.
The schema is defined by the CycloneDX specification: https://github.com/CycloneDX/specification/tree/master/schema
But our Go code is not adhering to it correctly, as detailed in #196. So the solution would be to modify the Go code, not the schema.
@nscuro Thanks for the clarification. I made the small change to the field type. I have some questions:
- In the code base, I see if conditions for checking spec version. For example
bom-1.6.schema.json, does it belong toif specVersion < SpecVersion1_6blocks orif specVersion < SpecVersion1_7blocks (which doesn't seem to exist yet). - How should I go about patching/adding tests for this specific field?
- I see a recursive func for
Componenthttps://github.com/CycloneDX/cyclonedx-go/blob/0a811bd89c4f709bfed304efd4245ce277f1d28c/convert.go#L554. From top level overview how does it work and would we have to do something similar forData *[]ComponentData?
@nscuro Hi, would you be able to address the comment above when you get a chance? Thank you!
Hello @nscuro We have a problem with this field too.
Is there a chance this PR will be merged? I am ready to help with changes if needed.
Best regards, Dmitriy