Skip to content

Commit 204a248

Browse files
nnobelissschuberth
authored andcommitted
fix(fossid-webapp): Make identificationCopyright nullable
FossId versions 25.1.0 and beyond return 'null' when this property is not set. Signed-off-by: Nicolas Nobelis <nicolas.nobelis@bosch.com>
1 parent 58f54da commit 204a248

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

clients/fossid-webapp/src/main/kotlin/model/identification/markedAsIdentified/MarkedAsIdentifiedFile.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ data class MarkedAsIdentifiedFile(
3232

3333
val identificationId: Int,
3434

35-
val identificationCopyright: String,
35+
val identificationCopyright: String?,
3636

3737
val isDistributed: Int,
3838

@@ -64,5 +64,5 @@ data class MarkedAsIdentifiedFile(
6464

6565
override fun getFileName(): String = checkNotNull(file.path)
6666

67-
override fun getCopyright(): String = identificationCopyright
67+
override fun getCopyright(): String = identificationCopyright.orEmpty()
6868
}

clients/fossid-webapp/src/test/resources/return-type/__files/body-list_scan_for_project_not_empty.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,35 @@
3737
"comment": "TestORT"
3838
}
3939
}
40+
},
41+
"3": {
42+
"row_id": "2",
43+
"file_id": "4611459",
44+
"file_path": "src/main/java/com/example/client/response/ReportResponse.java",
45+
"is_distributed": "1",
46+
"file_md5": "b8a8c00bf1dea4d52cb6a842b7affe08",
47+
"file_sha1": "da7c6657784025f38d5bb64733004ca01aa17ac0",
48+
"file_sha256": "af0254a01efd2ff2bdabce1299d8232625025330c711cf8bece7e566596aea2f",
49+
"file_size": "377",
50+
"identification_id": "29648306",
51+
"identification_copyright": null,
52+
"components": {
53+
"352": {
54+
"identification_id": 29648306,
55+
"component_id": 352,
56+
"component_name": "Original Code",
57+
"component_version": "Unspecified",
58+
"component_copyright": null,
59+
"component_cpe": null,
60+
"component_license_name": "[template] Basic Proprietary Commercial License",
61+
"component_license_identifier": "[template] Basic Proprietary Commercial License",
62+
"component_license_is_foss": 0,
63+
"component_license_is_spdx_standard": 0,
64+
"component_include_in_report": 1,
65+
"component_is_copyleft": 0,
66+
"component_identified_date": "2025-12-08 09:13:10"
67+
}
68+
}
4069
}
4170
}
4271
}

0 commit comments

Comments
 (0)