I came across this interesting use case when I was trying to unmarshall some JSON into case classes and I wanted to take into account missing properties or keys. Since I have been using Golang prior to using Scala, this was quite natural in Golang as it automatically took care of missing properties. Let’s dive into the following example to find out what exactly I am talking about.

Consider the case class: