class CycloneDX::Metadata

Included Modules

Defined in:

cyclonedx/metadata.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(component : Component | Nil = nil, tools : Array(Tool) | Nil = nil, authors : Array(OrganizationalContact) | Nil = nil, timestamp : String | Nil = nil, properties : Array(Property) | Nil = nil, lifecycles : Array(Lifecycle) | Nil = nil, manufacture : OrganizationalEntity | Nil = nil, supplier : OrganizationalEntity | Nil = nil, manufacturer : OrganizationalEntity | Nil = nil, licenses : Array(License | LicenseExpression) | Nil = nil, tool_components : Array(Component) | Nil = nil, tool_services : Array(Service) | Nil = nil) #

[View source]

Instance Method Detail

def authors : Array(OrganizationalContact) | Nil #

[View source]
def component : Component | Nil #

[View source]
def licenses : Array(License | LicenseExpression) | Nil #

[View source]
def lifecycles : Array(Lifecycle) | Nil #

[View source]
def manufacture : OrganizationalEntity | Nil #

[View source]
def manufacturer : OrganizationalEntity | Nil #

1.6+. Distinct from the older, deprecated #manufacture below.


[View source]
def properties : Array(Property) | Nil #

[View source]
def supplier : OrganizationalEntity | Nil #

[View source]
def timestamp : String | Nil #

[View source]
def to_xml(xml : XML::Builder) #

[View source]
def tool_components : Array(Component) | Nil #

[View source]
def tool_services : Array(Service) | Nil #

[View source]
def tools : Array(Tool) | Nil #

#tools has two mutually exclusive shapes in the schema (an xs:choice in XML, a oneOf in JSON), so it cannot be a single generated field:

  • the original flat list of toolType — deprecated from 1.5 but still valid in every supported version, and what this library emits;
  • from 1.5 on, an object of full components/services, which is what current third-party producers (syft, trivy, cdxgen, …) write.

All three are serialized by hand in on_to_json/#to_xml and parsed in on_unknown_json_attribute.


[View source]