Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an out of the box (de)serializer for UUID in json4s?

Tags:

json4s

I'm having a problem very similar to what's described here: Combining type and field serializers

case class(id: Option[UUID], otherValue:String, … )

The answer to the related question would allow me to write my own format, but I'm curious if there is already a format for UUID hiding somewhere in json4s. I'd guessed that the right import would solve this issue for UUID, and I was a bit surprised not to find anything.

Did I miss it, or is it not there yet?

like image 222
iwein Avatar asked Jun 01 '14 07:06

iwein


1 Answers

Since my pull request was merged, there is JavaTypesSerializers.

Usage:

implicit lazy val formats = Serialization.formats(NoTypeHints) ++ 
                            org.json4s.ext.JavaTypesSerializers.all
like image 165
iwein Avatar answered Oct 13 '22 10:10

iwein