我遇到的问题与此处描述的问题非常相似:Combining type and field serializers
case class(id: Option[UUID], otherValue:String, … )
the related question的答案将允许我编写自己的格式,但是我很好奇是否已经在json4s中的某处隐藏了UUID的格式。我猜想正确的导入将解决UUID的这个问题,我很惊讶没有找到任何东西。
我想念它了吗,还是还没有呢?
最佳答案
由于my pull request被合并,所以有了JavaTypesSerializers。
用法:
implicit lazy val formats = Serialization.formats(NoTypeHints) ++
org.json4s.ext.JavaTypesSerializers.all
关于json4s - json4s中是否有针对UUID的开箱即用的(反)序列化器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23977779/