How to represent optional fields in spray-json?

前端 未结 6 984
伪装坚强ぢ
伪装坚强ぢ 2021-02-07 06:36

I have an optional field on my requests:

case class SearchRequest(url: String, nextAt: Option[Date])

My protocol is:

object Sea         


        
6条回答
  •  我在风中等你
    2021-02-07 07:23

    Use NullOptions trait to disable skipping nulls: https://github.com/spray/spray-json#nulloptions Example: https://github.com/spray/spray-json/blob/master/src/test/scala/spray/json/ProductFormatsSpec.scala

提交回复
热议问题