Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 12:25
    justdoit0823 starred json4s/json4s
  • Jan 30 2019 11:05
    ericxsun commented #212
  • Jan 26 2019 13:29

    seratch on v3.6.4

    (compare)

  • Jan 26 2019 13:28

    seratch on 3.6

    version 3.6.4 Start 3.6.5 dev (compare)

  • Jan 26 2019 12:53

    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)

  • Jan 26 2019 12:53
    seratch closed #582
  • Jan 26 2019 12:39
    seratch synchronize #582
  • Jan 26 2019 12:39

    seratch on 3.6

    fix Type alias for parameterize… Merge branch '3.6' into pr-577-… Merge pull request #581 from se… (compare)

  • Jan 26 2019 12:39
    seratch closed #581
  • Jan 26 2019 12:38
    seratch synchronize #582
  • Jan 26 2019 12:38
    seratch opened #582
  • Jan 26 2019 12:30
    seratch synchronize #581
  • Jan 26 2019 12:30

    seratch on 3.6

    Add 3.6.3 to previous versions … (compare)

  • Jan 26 2019 12:25

    seratch on master

    Reduced OrElse objects allocati… (compare)

  • Jan 26 2019 12:25
    seratch closed #580
  • Jan 26 2019 12:25
    seratch closed #579
  • Jan 26 2019 12:25
    seratch commented #580
  • Jan 26 2019 11:03
    poslegm commented #580
  • Jan 26 2019 10:56
    poslegm synchronize #580
  • Jan 26 2019 10:32
    seratch commented #580
Marius B. Kotsbak
@mkotsbak
Hi
How to use Int with json4s serialazing?
Seems to either use BigInt or Long, both of which fails to deserialize to Int
kumariitr
@kumariitr
Hi
I want to create a pull request for json4s library
have added a new feature
can you please guide me?
Daniela Sfregola
@DanielaSfregola
Hi guys, I have a case class similar to the following: case class Test(seq: Seq[Long]). I have the problem that json4s matches every json as a valid for that case class, as {} is automatically filled as empty list
I am using the DefaultFormats, is there a way to tell json4s that it should not consider {} as a valid json for that case class?
thanks!
André Luiz Diniz
@andrelu
Is there a way given a case class T write it as a JValue?
Adianto Wibisono
@wibisono

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.

This message was deleted
skchrko
@skchrko
Hello, I want to parse invalid JSON with json4s via jackson
(that json has single quotes around names)
jackson has an option for it,
ObjectMapper mapper = new ObjectMapper();
mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
but how can I tell json4s to use that jackson configuration?
skchrko
@skchrko
oh, just JsonMethods.mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true), it seems.
Sam Smoot
@sam
Hi, I was just wondering if there's macros or anything for case-classes to produce a JsonFormat[MyCaseClass]? Like spray-json's jsonFormatN, or Argonaut's casecodecN helpers?
Sandeep Kota
@sandeepkota
Hi all,
From json string, based on the value of some Node, I would like to create a Scala Object. Do we have any formatters like in spring json?
Sandeep Kota
@sandeepkota
This should happen, while extracting the object from JSON String.
Eugene Platonov
@jozic

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?

Wei Zhao
@fishmacs
Hi, Can a JArray be sliced?
in querying
Wei Zhao
@fishmacs
Yeah, there is a slice method
Wei Zhao
@fishmacs
I want to query a value as JDouble or JInt
for {
...
JField(“field”, JDouble(field)) <- obj
}
querying failed if field is a int,how do I handle both double and int?
Kazuhiro Sera
@seratch
Pedro Silva
@pedromss
Hello, is there a way to transform an instance of type T into a json tree of type JValue? All I see in the documentation is the direct transformation from instance to string.
Sam Smoot
@sam
@pedromss org.json4s.Extract.decompose(myObject)?
Pedro Silva
@pedromss
I'm using version 3.3.0 and that function caused problems when converting an Object that contained another object which in turn contained a Map. I was hoping to avoid it this time. Will try it again since it's a different context, thx.
Matt Farmer
@farmdawgnation
Hey everyone.
Don’t know how much this room is monitored, but I wanted to bring something to everyone’s attention.
It looks like the json4s native API broke compatibility with lift-json with regard to extracting polymorphic types.
Minimal example forthcoming...
But wanted to flag here in case someone wanted to say “No, there’s some known changed behavior between json4s and lift-json"
marios iliofotou
@imarios

Hi guys, anyone knows if there is a way to extract from a parsed string a class that looks like this?

case class Something(a: Int, b: Long, c: Option[Map[String,Any]])

I know that it has 3 fields but c can be an arbitrary json, so I want to extract what I can and then tread c differently down the road.

Bjørn Rustad
@burk
Hey guys! Is there any reason to believe that the memory footprint of parsing and transforming a large amount of json will be different between json4s.native and json4s.jackson?
Filippo De Luca
@filosganga

Hi Guys, I would like to write a serialiser for a class with a type parameter:

class Foo[T](val t: T)

How is it possible in json4s?

marios iliofotou
@imarios
Hey guys, I create a SO question for what I asked few days, back, let me know if you can help, thanks! http://stackoverflow.com/questions/41709882/json4s-extractor-for-partial-fields-when-we-care-to-preserve-the-original-json
marios iliofotou
@imarios
@mxl thanks for the answer on SO!
marios iliofotou
@imarios
Hi all! is there a way for json4s to give the line causing the syntax error in the stack trace?
Justin Reeves
@justinallenreeves
I'm a novice having some trouble using Json4s to extract a given hit from this json response. First thing first I have to decide on is the right data structure.
{
  "took":2,
  "timed_out":false,
  "_shards":{
    "total":4,
    "successful":4,
    "failed":0
  },
  "hits":{
    "total":3,
    "max_score":0.19245009,
    "hits":[{
      "_index":"production",
      "_type":"listings",
      "_id":"94936767",
      "_score":0.19245009,
      "fields":{
        "status":["Live"]
      }
    }]
  }
}
Reduced that down so there's only one result showing.