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

feat: add JSON Schema to JSON output #80

Merged
merged 1 commit into from
Mar 2, 2023
Merged

feat: add JSON Schema to JSON output #80

merged 1 commit into from
Mar 2, 2023

Conversation

mcombuechen
Copy link
Contributor

This adds a $schema field to the JSON output, to achieve parity with the CycloneDX JavaScript library. The value points to the JSON schema definition file at cyclonedx.org.

@mcombuechen
Copy link
Contributor Author

Addresses Issue #79

Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mcombuechen!

There's an additional area where the JSON schema needs to be set, namely when converting between schema versions:

cyclonedx-go/convert.go

Lines 79 to 80 in 39a1d8f

b.SpecVersion = specVersion
b.XMLNS = xmlNamespaces[specVersion]

Signed-off-by: Maximilian Combüchen <[email protected]>
@mcombuechen mcombuechen marked this pull request as ready for review March 2, 2023 10:47
@mcombuechen mcombuechen requested a review from a team as a code owner March 2, 2023 10:47
@mcombuechen mcombuechen requested a review from nscuro March 2, 2023 10:48
@mcombuechen
Copy link
Contributor Author

@nscuro made the change to the convert.go and updated the snapshots.

@nscuro nscuro merged commit 221e639 into CycloneDX:master Mar 2, 2023
@mcombuechen mcombuechen deleted the feat/json-schema branch March 2, 2023 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants