Skip to content

Instantly share code, notes, and snippets.

View holograph's full-sized avatar

Tomer Gabel holograph

View GitHub Profile
@holograph
holograph / ChainedEnumSerializer.scala
Created December 18, 2012 15:22
A workaround for the Lift-JSON bug documented here: https://github.com/lift/framework/issues/1080 Basically works by providing a single serializer for multiple enumerations, the order of which determines behavior in case of value collisions. Forked from a gist I accidentally created anonymously.
package com.tomergabel.examples
import net.liftweb.json._
import net.liftweb.json.JsonDSL._
/**
* A chained object which provides JSON serialization/deserialization facilities for multiple enumerations.
* Intended as a workaround for the following issue: https://github.com/lift/framework/issues/1080
*
* To use simply add to your formats: `implicit val formats = DefaultFormats + new ChainedEnumSerializer( enum1, enum2 )`