spray json implicit UUID conversion
It probably should've been resolved, however, I ran into the same issue lately (While using akka-http v10.0.0
) and I was able to resolve it by defining the following
implicit object UUIDFormat extends JsonFormat[UUID] {
def write(uuid: UUID) = JsString(uuid.toString)
def read(value: JsValue) = {
value match {
case JsString(uuid) => UUID.fromString(uuid)
case _ => throw new DeserializationException("Expected hexadecimal UUID string")
}
}
}
The solution was borrowed from Fidesmo API.
Update:
I added a library that go through the most common use cases. <Link here>