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

Support snippets #118

Open
antonbauhofer opened this issue Nov 6, 2023 · 0 comments
Open

Support snippets #118

antonbauhofer opened this issue Nov 6, 2023 · 0 comments
Labels

Comments

@antonbauhofer
Copy link
Collaborator

antonbauhofer commented Nov 6, 2023

Currently, the library does not support snippets. To do that, the following steps are necessary:

  1. Add snippets to the spdx2model with properties according to https://spdx.github.io/spdx-spec/v2.3/snippet-information/. The class should have a constructor that takes the required arguments and an object for all optional properties, described by an interface. Consider if there are properties for which we can assume default values. Check for example the file or the package class for reference. Don't forget to add it to document.

  2. Add method addSnippet to the api. The method should take as few required arguments as possible and take all remaining optional arguments in an object. Add an interface for all optional parameters. Add a static method fromApi to the snippets class in spdx2model to enable creating snippets from the api.

  3. Add snippets to the json converter. Implement a class JsonSnippet with properties according to https://github.com/spdx/spdx-spec/blob/development/v2.3.1/schemas/spdx-schema.json. The class should have a static method fromSnippet that can be used to convert snippets from spdx2model to JsonSnippet. Don't forget to add it to document.

  4. Extend the "elaborate" test in the converter tests with all added properties to verify that the created json is valid.

  5. Extend the elaborate sample sbom and make sure that the CI is green when creating a PR.

  6. Add snippets to DOCUMENTATION.md, including the required and optional properties.

  7. Mark snippets as DONE in README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant