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: optionally output to json #87

Merged
merged 8 commits into from
Jan 7, 2025
Merged

Conversation

jeremylong
Copy link
Contributor

resolves #62

@jeremylong
Copy link
Contributor Author

This code is still missing test cases. But I have tested it locally and it appears to work well. I will move this from a draft once I have added test cases.

@jeremylong
Copy link
Contributor Author

@macblazer I'd appreciate an opinion on this PR. Are you okay with mixing the JSON generation into the single bom_builder class or should there be two builders?

Ideally, to do this would mean re-writing a good portion of the library to generate a model and then use serialization to output the XML or JSON. However, I do not have time to do this.

@macblazer
Copy link
Contributor

I think this approach is acceptable for now. The time involved with refactoring into a model is one of the reasons the original feature request has been sitting for so long.

The cyclonedx-ruby-gem project is also written in Ruby. If there were to be a common Ruby model library for the specification, both this CocoaPods analysis and the RubyGem analysis would benefit from it.

@jeremylong
Copy link
Contributor Author

Honestly, this code was mostly written using Cody. I've never written any Perl and this is the first Ruby I've touched. CHOP for the win ;)

It might not take very long to convert over to a model based approach using tools like Cody.

resolves CycloneDX#62

Signed-off-by: Jeremy Long <[email protected]>
Signed-off-by: Jeremy Long <[email protected]>
Signed-off-by: Jeremy Long <[email protected]>
Signed-off-by: Jeremy Long <[email protected]>
Signed-off-by: Jeremy Long <[email protected]>
@jeremylong jeremylong marked this pull request as ready for review December 21, 2024 14:07
@jeremylong jeremylong requested a review from a team as a code owner December 21, 2024 14:07
@jeremylong
Copy link
Contributor Author

This PR is good to go now. If this is good enough for now - great. When I have more time I might come back to this and see about converting this to using a model and serialization.

It would be good to see this merged and 2.0.0 released.

@jeremylong
Copy link
Contributor Author

@macblazer any chance this could get merged a new release created? There are several changes pending the next release:

1.4.1...main

(also - I might suggest using squash-and merge to reduce the noise in the commit history of main)

@macblazer macblazer merged commit 9cbc432 into CycloneDX:main Jan 7, 2025
5 checks passed
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.

Output in JSON format
2 participants