Skip to content

Commit e4cff6d

Browse files
authored
breaking: Support license expressions in SBOM [TAROT-3634] (#102)
1 parent 0a803de commit e4cff6d

File tree

1 file changed

+5
-2
lines changed
  • codacy-plugins-api/src/main/scala/com/codacy/plugins/api/results

1 file changed

+5
-2
lines changed

codacy-plugins-api/src/main/scala/com/codacy/plugins/api/results/Result.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ object Result {
9898
version: Option[String],
9999
purl: Option[String],
100100
properties: List[Property],
101-
licenses: Option[List[LicenseWrapper]])
101+
licenses: Option[List[LicenseType]])
102102

103103
object Component {
104104
type Type = Type.Value
@@ -122,7 +122,10 @@ object Result {
122122
/** A name-value pair representing a piece of information not officially supported by the SBOM schema. */
123123
case class Property(name: String, value: String)
124124

125-
case class LicenseWrapper(license: License)
125+
/** Licenses can be either an expresion ([[LicenseExpression]]) or an identified license ([[LicenseWrapper]]). */
126+
sealed trait LicenseType
127+
case class LicenseWrapper(license: License) extends LicenseType
128+
case class LicenseExpression(expression: String, `bom-ref`: Option[String]) extends LicenseType
126129

127130
/** A software license.
128131
*

0 commit comments

Comments
 (0)