Skip to content

Component description does not end up in the xml output #169

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

Closed
schlenk opened this issue Feb 15, 2022 · 3 comments · Fixed by #172
Closed

Component description does not end up in the xml output #169

schlenk opened this issue Feb 15, 2022 · 3 comments · Fixed by #172
Assignees
Labels
bug Something isn't working
Milestone

Comments

@schlenk
Copy link
Contributor

schlenk commented Feb 15, 2022

I tried to add a component description, but it does not end up in the generated XML file.

from cyclonedx.model.component import Component
from cyclonedx.model.bom import Bom
from cyclonedx.output import BaseOutput, get_instance, OutputFormat, SchemaVersion
from cyclonedx.parser import BaseParser

class TrivialParser(BaseParser):

    def __init__(self):
        c = Component(name='foo',
                      version='1.0.0',
                      description='My description',
                      author='My Author')
        self._components.append(c)


parser = TrivialParser()
bom = Bom.from_parser(parser)
inst = get_instance(
    bom=bom,
    output_format=OutputFormat['XML'],
    schema_version=SchemaVersion['V{}'.format(
        str(1.4).replace('.', '_')
    )]
)
inst.output_to_file('bom.xml')

The output does not contain the description content.

I would expect the XML output to contain the description text, as specified in the schema
(https://cyclonedx.org/docs/1.4/xml/#type_component)

Is this just an usage error or missing functionality?

@madpah
Copy link
Collaborator

madpah commented Feb 15, 2022

Hi @schlenk - thanks for the report.

Can you share the version of cyclonedx-python-lib you are using?

@schlenk
Copy link
Contributor Author

schlenk commented Feb 15, 2022

Sure, installed via pip on Python 3.9.7 on Windows.

cyclonedx-python-lib 1.3.0

@madpah madpah added the bug Something isn't working label Feb 16, 2022
@madpah madpah self-assigned this Feb 16, 2022
@madpah madpah added this to the 2.0.0 milestone Feb 16, 2022
@madpah
Copy link
Collaborator

madpah commented Feb 16, 2022

Thanks @schlenk - you are correct - you've found a bug.

We'll get this fixed in the upcoming 2.0.0 release shortly.

Thanks again for the report!

madpah added a commit that referenced this issue Feb 16, 2022
fix: resolved #169 (part of #155)
feat: as part of solving #155, #147 has been implemented

Signed-off-by: Paul Horton <[email protected]>
@madpah madpah linked a pull request Feb 16, 2022 that will close this issue
@madpah madpah closed this as completed in a926b34 Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants