File tree Expand file tree Collapse file tree 1 file changed +18
-19
lines changed
cortex/dto/src/main/scala/org/thp/cortex/dto/v0 Expand file tree Collapse file tree 1 file changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -14,25 +14,24 @@ case class OutputWorker(
14
14
15
15
object OutputWorker {
16
16
implicit val writes : Writes [OutputWorker ] = Json .writes[OutputWorker ]
17
- implicit val reads : Reads [OutputWorker ] = Reads [OutputWorker ](
18
- json =>
19
- for {
20
- id <- (json \ " id" ).validate[String ]
21
- name <- (json \ " name" ).validate[String ]
22
- version <- (json \ " version" ).validate[String ]
23
- description <- (json \ " description" ).validate[String ]
24
- dataTypeList <- (json \ " dataTypeList" ).validate[Seq [String ]]
25
- maxTlp = (json \ " maxTlp" ).asOpt[Long ].getOrElse(3L )
26
- maxPap = (json \ " maxPap" ).asOpt[Long ].getOrElse(3L )
27
- } yield OutputWorker (
28
- id,
29
- name,
30
- version,
31
- description,
32
- dataTypeList,
33
- maxTlp,
34
- maxPap
35
- )
17
+ implicit val reads : Reads [OutputWorker ] = Reads [OutputWorker ](json =>
18
+ for {
19
+ id <- (json \ " id" ).validate[String ]
20
+ name <- (json \ " name" ).validate[String ]
21
+ version <- (json \ " version" ).validate[String ]
22
+ description <- (json \ " description" ).validate[String ]
23
+ dataTypeList <- (json \ " dataTypeList" ).validateOpt[Seq [String ]]
24
+ maxTlp = (json \ " maxTlp" ).asOpt[Long ].getOrElse(3L )
25
+ maxPap = (json \ " maxPap" ).asOpt[Long ].getOrElse(3L )
26
+ } yield OutputWorker (
27
+ id,
28
+ name,
29
+ version,
30
+ description,
31
+ dataTypeList.getOrElse(Nil ),
32
+ maxTlp,
33
+ maxPap
34
+ )
36
35
)
37
36
}
38
37
You can’t perform that action at this time.
0 commit comments