Skip to content

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

Closed

Description

@schlenk

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?

Activity

  1. madpah commented on Feb 15, 2022

    @madpah
    Collaborator

    Hi @schlenk - thanks for the report.

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

  2. schlenk commented on Feb 15, 2022

    @schlenk
    ContributorAuthor

    Sure, installed via pip on Python 3.9.7 on Windows.

    cyclonedx-python-lib 1.3.0

  3. added
    bug
    on Feb 16, 2022
  4. self-assigned this
    on Feb 16, 2022
  5. added this to the 2.0.0 milestone on Feb 16, 2022
  6. madpah commented on Feb 16, 2022

    @madpah
    Collaborator

    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!

  7. added a commit that references this issue on Feb 16, 2022
    02d2ba8
  8. linked a pull request that will close this issuefeat: completed work on #155 #172on Feb 16, 2022
  9. added a commit that references this issue on Feb 16, 2022
    a926b34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions