case class Reason(name: String, flag: Option[Boolean])
implicit val conf = JsonConfiguration(optionHandlers = OptionHandlers.WritesNull)
implicit val jsonFormat = Json.format[Reason]
This would emit null for "flag" if the value is None.
Is something similar available for use with Jsonx.formatCaseClass invocation?
Is there any way to write None values as null?
With play.api.libs.json.Json, I could do this:
This would emit null for "flag" if the value is None.
Is something similar available for use with Jsonx.formatCaseClass invocation?