Looks like this is another bug in Scala 2.9 version (Scala 2.9 no longer
fully works with Java reflection, lift-json-2.4 uses parses required
information from ScalaSig annotation), the code below works on 2.8.
Could you please file a ticket and assign to me.
Serialization of algebraic sum types is automated but requires use of a
type hint (an extra field added to JSON):
implicit val formats =
DefaultFormats + FullTypeHints(classOf[SingleOrVector[_]] :: Nil)
Cheers Joni
> at net.liftweb.json.Meta$$anonfun$constructors$1
> $1.apply(Meta.scala:97)
> at net.liftweb.json.Meta$$anonfun$constructors$1
> $1.apply(Meta.scala:96)
> at scala.collection.TraversableLike$$anonfun$map
> $1.apply(TraversableLike.scala:194)
> at scala.collection.TraversableLike$$anonfun$map
> $1.apply(TraversableLike.scala:194)
> at scala.collection.LinearSeqOptimized
> $class.foreach(LinearSeqOptimized.scala:59)
> at scala.collection.immutable.List.foreach(List.scala:45)
> at scala.collection.TraversableLike
> $class.map(TraversableLike.scala:194)
> at scala.collection.immutable.List.map(List.scala:45)
> at net.liftweb.json.Meta$.constructors$1(Meta.scala:96)
> at net.liftweb.json.Meta$$anonfun$mappingOf$1.apply(Meta.scala:164)
> at net.liftweb.json.Meta$$anonfun$mappingOf$1.apply(Meta.scala:159)
> at net.liftweb.json.Meta$Memo.memoize(Meta.scala:198)
> at net.liftweb.json.Meta$.mappingOf(Meta.scala:159)
> at net.liftweb.json.Extraction$.mkMapping$1(Extraction.scala:192)
> at net.liftweb.json.Extraction$.net$liftweb$json$Extraction
> $$extract0(Extraction.scala:194)
> at net.liftweb.json.Extraction$.extract(Extraction.scala:42)
> ... 9 more
>
>
> Process finished with exit code 1
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/liftweb/-/RzxvFlb0uhgJ.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb
> +unsub...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
Hi,Looks like this is another bug in Scala 2.9 version (Scala 2.9 no longer
fully works with Java reflection, lift-json-2.4 uses parses required
information from ScalaSig annotation), the code below works on 2.8.
Could you please file a ticket and assign to me.
Serialization of algebraic sum types is automated but requires use of a
type hint (an extra field added to JSON):implicit val formats =
DefaultFormats + FullTypeHints(classOf[SingleOrVector[_]] :: Nil)
On Wed, 2011-07-27 at 05:03 -0700, Miguel Negrão wrote:
> Ah, great, that's less work for me ! I have other cases where I'm
> making a serializer object in order to convert lists that I have in my
> case classes to the right collection type that use, most usually
> IndexedSeq. Is this the best way to do it ? Example :
Unfortunately that's what you need to do now. I filed an enhancement
ticket which should make your life easier:
After that it is possible to add support for IndexedSeq using a custom
serializer.
Cheers Joni