Scala Play没有可用的Seq [Option [models.ProcessStepTemplatesModel]]的隐式格式

时间:2017-07-03 11:11:30

标签: scala playframework

我有scala Play应用程序,我想做这样的事情:

implicit val ProcessStepsFormat: OFormat[ProcessSteps] = Json.format[ProcessSteps]

case class ProcessSteps(stepsData: Seq[Option[ProcessStepTemplatesModel]])

问题是我收到了这个错误:

No implicit format for Seq[Option[models.ProcessStepTemplatesModel]] available.

如何更改它的工作格式?

非常感谢

更新

case class ProcessStepTemplatesModel(
                                      id: Option[Int],
                                      title: String,
                                      createdat: String,
                                      updatedat: String,
                                      deadline: Option[Date],
                                      comment: Option[String],
                                      stepType: Int,
                                      deleted: Boolean,
                                      processtemplate: Option[Int],
                                      derivedProcesses: Seq[ProcessStepTemplatesDerivedProcessesModel],
                                      prerequisites: Seq[ProcessStepPrerequisitesModel],
                                      postconditions: Seq[ProcessStepPostconditionModel],
                                      addProcessToProcessStepArray: Seq[ProcessStepsTemplates_ProcessTemplatesModel])

object ProcessStepTemplatesModel {
  implicit val processStepFormat = Json.format[ProcessStepTemplatesModel]
}

1 个答案:

答案 0 :(得分:1)

您是否为ProcessStepTemplatesModel声明了隐式格式?