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

factories in web browser not working as expected #883

Closed
jkowalleck opened this issue Jul 2, 2023 · 0 comments · Fixed by #880
Closed

factories in web browser not working as expected #883

jkowalleck opened this issue Jul 2, 2023 · 0 comments · Fixed by #880
Labels
bug Something isn't working

Comments

@jkowalleck
Copy link
Member

based on https://github.com/CycloneDX/cyclonedx-javascript-library/blob/bad2c33cbc13480d09223ded7ae164264010b3ff/examples/web/example.html

bom.metadata.component.licenses.add(lFac.makeFromString('MIT OR Apache-2.0'))

should cause a SPDX license expression, like it does on nodejs

componentA.purl = purlFac.makeFromComponent(componentA)

should cause a non-empy packageurl.

output is:

  • JSON

    {"$schema":"http://cyclonedx.org/schema/bom-1.4.schema.json","bomFormat":"CycloneDX","specVersion":"1.4","version":1,"metadata":{"component":{"type":"application","name":"MyProject","bom-ref":"BomRef.37jhh9s8fm8.h0pa79tlcq4","licenses":[{"license":{"name":"MIT OR Apache-2.0"}}]}},"components":[{"type":"library","name":"myComponentA","group":"acme","version":"1.33.7","bom-ref":"BomRef.5baklf4ahso.il99vjaajao","licenses":[{"license":{"id":"Apache-2.0"}}]}],"dependencies":[{"ref":"BomRef.37jhh9s8fm8.h0pa79tlcq4","dependsOn":["BomRef.5baklf4ahso.il99vjaajao"]},{"ref":"BomRef.5baklf4ahso.il99vjaajao"}]}
  • xml

    <bom xmlns="http://cyclonedx.org/schema/bom/1.5" version="1"><metadata><component type="application" bom-ref="BomRef.1pfapsodgso.m872od7jsi4"><name>MyProject</name><licenses><license><name>MIT OR Apache-2.0</name></license></licenses></component></metadata><components><component type="library" bom-ref="BomRef.5ep3p4on298.ih5j85qfqfc"><group>acme</group><name>myComponentA</name><version>1.33.7</version><licenses><license><id>Apache-2.0</id></license></licenses></component></components><dependencies><dependency ref="BomRef.1pfapsodgso.m872od7jsi4"><dependency ref="BomRef.5ep3p4on298.ih5j85qfqfc"/></dependency><dependency ref="BomRef.5ep3p4on298.ih5j85qfqfc"/></dependencies></bom>
    
  • it is expected to have a licen sexpresson, but instead a named licenses is used

  • it is expected to have a purl, but there is none.

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
1 participant