A feature request. Right now I might have a case class like so:
case class User(firstname: String, lastname: String)
which serializes to something like:
{ "firstname" : "Harry", "lastname" : "Heymann" }
but I happen to be serializing a lot of People and I hate to use 17
bytes per item for the
When converting XML to Json attributes are being lost, given the below XML
document, we would expect
{"word":{"word":"content","self":"http://localhost:8080/word/example
","term":"example","available":"true"}}
where as we get {"word":"content"}
example XML:
http://localhost:8080/word/example";
avai
On Thursday December 10 2009, harryh wrote:
> ...
>
> since this won't work (as type is a scala keyword):
>
> case class Foo(type: String)
Back-ticks forgive all:
case class Foo(`type`: String)
> -harryh
Randall Schulz
--
You received this message because you are subscribed to the Google Gr
On Thu, Dec 10, 2009 at 4:14 PM, harryh wrote:
> I feel like there has been a post on this before, but I can't seem to
> find it. How can I construct a case class that can deal with json
> like so:
>
> {
> "type" : "image"
> }
>
> since this won't work (as type is a scala keyword):
>
> case cla
Backticks.
-
harryh wrote:
I feel like there has been a post on this before, but I can't seem to
find it. How can I construct a case class that can deal with json
like so:
{
"type" : "image"
}
since this won't work (as type is a scala keyword):
case class
I feel like there has been a post on this before, but I can't seem to
find it. How can I construct a case class that can deal with json
like so:
{
"type" : "image"
}
since this won't work (as type is a scala keyword):
case class Foo(type: String)
-harryh
--
You received this message becaus
scala> import net.liftweb.json._
scala> val s2 = "{ \"id\": \"America\\/New_York\" }"
s2: java.lang.String = { "id": "America\/New_York" }
scala> JsonParser.parse(s2)
res1: net.liftweb.json.JsonAST.JValue = JObject(List(JField(id,JString
(America\New_York
It should be America/New_York but for
consider:
case class Foo(id: Int, bars: List[Bar])
case class Bar(id: Int)
val foo = json.extract[Foo]
The following json will cause a problem:
{
"id": 12
}
This can be fixed by changing bars to an Option[List[Bar]]. Should
that really be necessary though? Can't bars just be an empty list
This is on M7:
scala> import
scala.xml.Elem
import scala.xml.Elem
scala> import
net.liftweb.json.JsonAST._
import net.liftweb.json.JsonAST._
scala> import
net.liftweb.json._
import net.liftweb.json._
scala> def go(e: Elem) = Printer.pretty(render(Xml.toJson
(e)))
go: (scala.xml.Elem)String
sc
Hi,
Is there a way to configure lift-json's case class serialization so that it
uses Joda DateTimes instead of java.util.Date ?
I'd like to known how to make the simple following code work as expected:
import net.liftweb.json._
import org.joda.time._
case class MyCaseClass(dt: DateTime)
object
Loving the new lift-json code. We've been producing XML for a REST
API, and now need to produce JSON. lift-json to the rescue,
except...the Xml converter doesn't handle attributes:
scala> val xml = Bert
xml: scala.xml.Elem = Bert
scala> val json = toJson(xml)
json: net.liftweb.json.JsonAST.JVa
First of all thanks for a great library. I'm finding lift-json quite useful
in my current project.
I have a use case where I need to convert a case class into a JObject. The
code is there, but it's wrapped inside the Serialization object. So, I took
the liberty of moving the serialize method to th
Hello, I saw a post about lift-json on the scala-user list so I
decided to check it out. I was particularly interested in the ability
to call something along the lines of json.extract[MyClass]. I set up
a little test case for this though, and apparently having a val of any
sort in my case class
13 matches
Mail list logo