Skip to content

Commit d87c9d2

Browse files
To-omnadouani
authored andcommitted
#12 Add default value for custom fields
1 parent 929039e commit d87c9d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

thehive-backend/app/models/Case.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ trait CaseAttributes { _: AttributeDef ⇒
4343
val flag: A[Boolean] = attribute("flag", F.booleanFmt, "Flag of the case", false)
4444
val tlp: A[Long] = attribute("tlp", F.numberFmt, "TLP level", 2L)
4545
val status: A[CaseStatus.Value] = attribute("status", F.enumFmt(CaseStatus), "Status of the case", CaseStatus.Open)
46-
val metrics: A[JsValue] = attribute("metrics", F.metricsFmt, "List of metrics")
46+
val metrics: A[JsValue] = attribute("metrics", F.metricsFmt, "List of metrics", JsObject(Nil))
4747
val resolutionStatus: A[Option[CaseResolutionStatus.Value]] = optionalAttribute("resolutionStatus", F.enumFmt(CaseResolutionStatus), "Resolution status of the case")
4848
val impactStatus: A[Option[CaseImpactStatus.Value]] = optionalAttribute("impactStatus", F.enumFmt(CaseImpactStatus), "Impact status of the case")
4949
val summary: A[Option[String]] = optionalAttribute("summary", F.textFmt, "Summary of the case, to be provided when closing a case")
5050
val mergeInto: A[Option[String]] = optionalAttribute("mergeInto", F.stringFmt, "Id of the case created by the merge")
5151
val mergeFrom: A[Seq[String]] = multiAttribute("mergeFrom", F.stringFmt, "Id of the cases merged")
52-
val customFields: A[JsValue] = attribute("customFields", F.customFields, "Custom fields")
52+
val customFields: A[JsValue] = attribute("customFields", F.customFields, "Custom fields", JsObject(Nil))
5353
}
5454

5555
@Singleton

0 commit comments

Comments
 (0)