From b3feae8e94de4868c03397debb8100a5c4ee58d4 Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Thu, 30 Nov 2023 12:36:24 +0100 Subject: [PATCH] feat(model): Add the property `Issue.affectedPath` This property can be set in case the issue is limited to a file or directory. This prepares for making use of it for ScanCode timeout issues, e.g. filter out irrelevant timeout issues if outside the VCS path or matched by a path exclude. Signed-off-by: Frank Viernau --- model/src/main/kotlin/Issue.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/model/src/main/kotlin/Issue.kt b/model/src/main/kotlin/Issue.kt index 4e6cf8320c075..3a2842af8ddf6 100644 --- a/model/src/main/kotlin/Issue.kt +++ b/model/src/main/kotlin/Issue.kt @@ -19,6 +19,7 @@ package org.ossreviewtoolkit.model +import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.core.JsonGenerator import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.databind.annotation.JsonSerialize @@ -53,7 +54,13 @@ data class Issue( /** * The issue's severity. */ - val severity: Severity = Severity.ERROR + val severity: Severity = Severity.ERROR, + + /** + * The affected file or directory the issue is limited to, if any. + */ + @JsonInclude(JsonInclude.Include.NON_NULL) + val affectedPath: String? = null ) { override fun toString(): String { val time = if (timestamp == Instant.EPOCH) "Unknown time" else timestamp.toString()