Skip to content

Commit

Permalink
chore(model): Do not serialize empty defects or vulnerabilities
Browse files Browse the repository at this point in the history
Most advisors only report either defects or vulnerabilities, but not
both, so omit either if empty from serialization.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed May 3, 2024
1 parent 8ed8e2b commit c080db0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions model/src/main/kotlin/AdvisorResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package org.ossreviewtoolkit.model

import com.fasterxml.jackson.annotation.JsonInclude

import org.ossreviewtoolkit.model.vulnerabilities.Vulnerability

/**
Expand All @@ -41,10 +43,12 @@ data class AdvisorResult(
/**
* The defects.
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
val defects: List<Defect> = emptyList(),

/**
* The vulnerabilities.
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
val vulnerabilities: List<Vulnerability> = emptyList()
)

0 comments on commit c080db0

Please sign in to comment.