Skip to content

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

@schlenk

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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions