Skip to content

[Feature Request] Add method for serialized SBOM output #143

Description

@philSixZero

Description

Currently, StandardBomParser only provides a save() method for writing the SBOM to a file. It would be helpful to also provide a to_json() method that returns the serialized SBOM content directly as JSON.

This would be especially useful in CLI and scripting contexts where the SBOM should be written to stdout or otherwise handled in-memory without creating a temporary file first.

Example

sbom_json = StandardBomParser.to_json(sbom, indent=4)
# or directly at the sbom object
sbom_json = sbom.to_json(indent=4)
print(sbom_json)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions