@@ -1010,11 +1010,9 @@ def __init__(
10101010 self .supplier = supplier
10111011 self .manufacturer = manufacturer
10121012 self .authors = authors or []
1013- self .author = author
10141013 self .publisher = publisher
10151014 self .group = group
10161015 self .name = name
1017- self .version = version
10181016 self .description = description
10191017 self .scope = scope
10201018 self .hashes = hashes or []
@@ -1025,7 +1023,6 @@ def __init__(
10251023 self .omnibor_ids = omnibor_ids or []
10261024 self .swhids = swhids or []
10271025 self .swid = swid
1028- self .modified = modified
10291026 self .pedigree = pedigree
10301027 self .external_references = external_references or []
10311028 self .properties = properties or []
@@ -1034,13 +1031,10 @@ def __init__(
10341031 self .release_notes = release_notes
10351032 self .crypto_properties = crypto_properties
10361033 self .tags = tags or []
1037-
1038- if modified :
1039- warn ('`.component.modified` is deprecated from CycloneDX v1.3 onwards. '
1040- 'Please use `@.pedigree` instead.' , DeprecationWarning )
1041- if author :
1042- warn ('`.component.author` is deprecated from CycloneDX v1.6 onwards. '
1043- 'Please use `@.authors` or `@.manufacturer` instead.' , DeprecationWarning )
1034+ # spec-deprecated properties below
1035+ self .author = author
1036+ self .modified = modified
1037+ self .version = version
10441038
10451039 @property
10461040 @serializable .type_mapping (_ComponentTypeSerializationHelper )
@@ -1175,6 +1169,9 @@ def author(self) -> Optional[str]:
11751169
11761170 @author .setter
11771171 def author (self , author : Optional [str ]) -> None :
1172+ if author is not None :
1173+ warn ('`@.author` is deprecated from CycloneDX v1.6 onwards. '
1174+ 'Please use `@.authors` or `@.manufacturer` instead.' , DeprecationWarning )
11781175 self ._author = author
11791176
11801177 @property
@@ -1255,7 +1252,7 @@ def version(self) -> Optional[str]:
12551252 @version .setter
12561253 def version (self , version : Optional [str ]) -> None :
12571254 if version and len (version ) > 1024 :
1258- warn ('`.component .version`has a maximum length of 1024 from CycloneDX v1.6 onwards.' , UserWarning )
1255+ warn ('`@ .version`has a maximum length of 1024 from CycloneDX v1.6 onwards.' , UserWarning )
12591256 self ._version = version
12601257
12611258 @property
@@ -1450,6 +1447,9 @@ def modified(self) -> bool:
14501447
14511448 @modified .setter
14521449 def modified (self , modified : bool ) -> None :
1450+ if modified :
1451+ warn ('`@.modified` is deprecated from CycloneDX v1.3 onwards. '
1452+ 'Please use `@.pedigree` instead.' , DeprecationWarning )
14531453 self ._modified = modified
14541454
14551455 @property
0 commit comments