3333if TYPE_CHECKING : # pragma: no cover
3434 from ..model .bom import Bom
3535 from ..model .bom_ref import BomRef
36- from ..model .contact import OrganizationalEntity
36+ from ..model .contact import OrganizationalContact , OrganizationalEntity
3737 from ..model .license import License
3838 from .json import Json as JsonOutputter
3939 from .xml import Xml as XmlOutputter
@@ -175,12 +175,18 @@ def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
175175 components = tuple (bom ._get_all_components ())
176176 services = tuple (bom .services )
177177 vulnerabilities = tuple (bom .vulnerabilities )
178- orgs : Iterable ['OrganizationalEntity' ] = filter (lambda o : o is not None , chain ( # type:ignore[arg-type]
178+ orgs : list ['OrganizationalEntity' ] = list ( filter (lambda o : o is not None , chain ( # type:ignore[arg-type]
179179 (bom .metadata .manufacture , bom .metadata .manufacturer , bom .metadata .supplier ),
180180 chain .from_iterable ((c .manufacturer , c .supplier ,) for c in components ),
181181 (s .provider for s in services ),
182182 chain .from_iterable (v .credits .organizations for v in vulnerabilities if v .credits ),
183- ))
183+ )))
184+ contacts : Iterable ['OrganizationalContact' ] = chain (
185+ bom .metadata .authors ,
186+ chain .from_iterable (c .authors for c in components ),
187+ chain .from_iterable (v .credits .individuals for v in vulnerabilities if v .credits ),
188+ chain .from_iterable (o .contacts for o in orgs ),
189+ )
184190 licenses : Iterable ['License' ] = chain (
185191 bom .metadata .licenses ,
186192 chain .from_iterable (c .licenses for c in components ),
@@ -193,6 +199,7 @@ def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
193199 services ,
194200 vulnerabilities ,
195201 orgs ,
202+ contacts ,
196203 (o .address for o in orgs if o .address is not None ),
197204 licenses ,
198205 )),
0 commit comments