Skip to content

Commit

Permalink
#53 Update analyzer json format (add "id" field)
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Dec 5, 2016
1 parent 4a89050 commit 7c1e8d2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion thehive-cortex/app/connectors/cortex/models/JsonFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ import java.io.File
import play.api.libs.json.{ JsObject, JsString, Json, OFormat, OWrites, Reads, Writes }
import play.api.libs.json.Json.toJsFieldJsValueWrapper
import org.elastic4play.models.JsonFormat.enumFormat
import play.api.libs.json.Format

object JsonFormat {
implicit val analyzerFormats = Json.format[Analyzer]
val analyzerWrites = Writes[Analyzer](analyzer Json.obj(
"id" analyzer.id,
"name" analyzer.name,
"version" analyzer.version,
"description" analyzer.description,
"dataTypeList" analyzer.dataTypeList,
"cortexIds" analyzer.cortexIds))
val analyzerReads = Json.reads[Analyzer]
implicit val analyzerFormats = Format(analyzerReads, analyzerWrites)

val fileArtifactWrites = OWrites[FileArtifact](fileArtifact Json.obj(
"attributes" fileArtifact.attributes))
Expand Down

0 comments on commit 7c1e8d2

Please sign in to comment.