class

CycloneDX::License

Inherits JSON::Serializable / Reference / Object

Constructors

new(id : String | Nil = nil, name : String | Nil = nil, url : String | Nil = nil, bom_ref : String | Nil = nil, text : AttachedText | Nil = nil, acknowledgement : String | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

acknowledgement
Source
bom_ref
Source
name
Source
text
Source
to_json(json : JSON::Builder)

CycloneDX LicenseChoice wraps the license object: {"license": {...}}. We override to_json (the JSON::Serializable-generated implementation would produce a flat object). from_json keeps the flat shape, which is fine because we never parse SBOM licenses arrays back in. id is preferred when present (canonical SPDX identifier); name is the free-form fallback for licenses not in the SPDX list.

Source
to_xml(xml : XML::Builder)
Source