seratch on v3.6.4
seratch on 3.6
version 3.6.4 Start 3.6.5 dev (compare)
seratch on 3.6
Reduced OrElse objects allocati… Merge branch '3.6' into pr-580-… Merge branch '3.6' into pr-580-… and 1 more (compare)
seratch on 3.6
fix Type alias for parameterize… Merge branch '3.6' into pr-577-… Merge pull request #581 from se… (compare)
seratch on 3.6
Add 3.6.3 to previous versions … (compare)
seratch on master
Reduced OrElse objects allocati… (compare)
json4s-native
3.3.x was an issue for another project: https://github.com/json4s/json4s/pull/339/files#r60582054
alwaysEncodeUnicode
option anyways. But if you do, I’m fairly confident the invalid-json-control-character bug is still present in that case.
scala> import org.json4s._
scala> import org.json4s.jackson.JsonMethods._
scala> implicit val formats = DefaultFormats // Brings in default date formats etc.
// I don’t want use case class here
scala> case class Child(name: String, age: Int, birthdate: Option[java.util.Date])
scala> case class Address(street: String, city: String)
scala> case class Person(name: String, address: Address, children: List[Child])
scala> val json = parse("""
{ "name": "joe",
"address": {
"street": "Bulevard",
"city": "Helsinki"
},
"children": [
{
"name": "Mary",
"age": 5,
"birthdate": "2004-09-04T18:06:22Z"
},
{
"name": "Mazy",
"age": 3
}
]
}
""")
DefaultFormats
, is there a way to tell json4s that it should not consider {}
as a valid json for that case class?
Hi,
If any of you have insight on what to do with legacy domain POJO, if we wanted to (de) serialize with json4s.
I saw a guy was asking question in StackOverflow from 2015, with no answer up to now : http://stackoverflow.com/questions/29789424/json4s-deserialisation-of-java-pojos.
So far what seems to work would be to have a matching Scala case classes for these POJOs, but this makes the domain model harder to maintain. If you guys have suggestions, please let me know.
Thanks in advance.
recently found myself in a need to convert optional field from json input to a sequence in a case class
like case class A(s: String, i: Seq[Int])
and json " { "s": "boo", "i": 5}"
or "{"s": "boo" }
managed to write a simple FieldSerializer that converts a specified JValue to JArray
def asArray(name: String): PartialFunction[JField, JField] = {
case JField(`name`, value) => JField(name, JArray(List(value)))
}
@seratch would you be interested in a pr to add this to FieldSerializer object along renameFrom
and others?