The types of the Reads object do not match the types of the Apply method. For example, readNullable[String] results in Option[String] , not String . The same goes for BSONObjectId and Date . This compiles, but you probably need to use some maps:
implicit val artifactModelReads: Reads[ArtifactModel] = ( (__ \ "_id").read[BSONObjectID] ~ (__ \ "name").read[String] ~ (__ \ "createdAt").read[Date] ~ (__ \ "updatedAt").read[Date] ~ (__ \ "attributes").read[List[AttributeModel]] ~ (__ \ "stateModels").read[List[StateModel]] )(ArtifactModel.apply _)
You can after reading, for example, ( CONVERT_TO_DATE is imaginary):
implicit val artifactModelReads: Reads[ArtifactModel] = ( (__ \ "_id").read[BSONObjectID] ~ (__ \ "name").read[String] ~ (__ \ "createdAt").read[String].map( s=>CONVERT_TO_DATE(s) ) ~ (__ \ "updatedAt").read[Date] ~ (__ \ "attributes").read[List[AttributeModel]] ~ (__ \ "stateModels").read[List[StateModel]] )(ArtifactModel.apply _)
source share