Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Add '' or "" to interpolated values in a logger message. It will help to avoid confusing with spaces (" ")
- // incorrect:
- Logger.info("Received treatment: $treatment")
- // correct:
- Logger.info("Received treatment: '$treatment'")
- 2. in build.sbt use '%%' pattern instead of '%'. It will help with upgrading in the future
- // incorrect:
- "com.typesafe.play" % "play-slick_2.11" % "3.0.1"
- // correct:
- "com.typesafe.play" %% "play-slick" % "3.0.1"
- 3. Use Seq instead of List in case classes to avoid problems with Json (de)-serializing:
- // incorrect
- case class Images(userId: Long, images: List[String])
- implicit val jsonFormat = Json.format[Images]
- // correct
- case class Images(userId: Long, images: Seq[String])
- implicit val jsonFormat = Json.format[Images]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement