Skip to content

Commit abebd4f

Browse files
committed
raise UserWarning in .component.version has length > 1024
Signed-off-by: Paul Horton <[email protected]>
1 parent 1327558 commit abebd4f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cyclonedx/model/component.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,8 @@ def version(self) -> Optional[str]:
12981298

12991299
@version.setter
13001300
def version(self, version: Optional[str]) -> None:
1301+
if version and len(version) > 1024:
1302+
warn('`.component.version`has a maximum length of 1024 from CycloneDX v1.6 onwards.', UserWarning)
13011303
self._version = version
13021304

13031305
@property

0 commit comments

Comments
 (0)