Scala Meta Live Coding Session
summary
Live coding builds a Scala Meta annotation that reads a case class annotated with resource and generates companion DTOs: a get case class with listed fields, a post case class with required fields, and a patch case class whose types are option-wrapped patch fields with default None. Implementation uses Scala 2.12, Scala Meta 1.8, quasiquotes, pattern-matching on Defn.Class/Companion, handles missing companion generation, and verifies correctness with sbt ~test and compile-time assertions.
AI-written summary · about
chapters (7)
- 0:00Start
- 1:45Why Macros
- 2:40What Are Macros
- 2:58Annotation Macros
- 14:28Create the Resource Annotation
- 14:40Restful Annotations
- 35:53Declare Type








