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
Colin Williams
@KE7CFN_twitter
Looks like I can extract the xpath elements but still I'm curious why the .values "Map" doesn't provide Map "methods"
scala> parsed.values.
!=   +    ==             ensuring   formatted   hashCode       toString   
##   ->   asInstanceOf   equals     getClass    isInstanceOf   →
Colin Williams
@KE7CFN_twitter
scala> parsed.values.getClass
res117: Class[_ <: parsed.Values] = class scala.collection.immutable.Map$Map4
Anirudh Vyas
@AnirudhVyas
Hi there - how do I convert a case class to JObject directly without handcoding jObject - So far I can only see parse(write(caseClassInstance).snakizeKeys.asInstanceOf[JObject] ... but that is a lot of work to get case class
Anirudh Vyas
@AnirudhVyas
by a lot of work I meant lot of I/O
Andriy Plokhotnyuk
@plokhotnyuk
@AnirudhVyas as w/a you can try jsoniter-scala. It derives a safe and efficient JSON codec for a whole nested data structure by a one-liner macro call like here.
Andy Czerwonka
@andyczerwonka
wondering if there is an established pattern for parsing an array of dynamic objects, e.g. List[Either[ThisType, ThatTYpe]]
{
  "stuff": [
    {
      "a": null,
      "b": "wombat",
      "c": [],
      "d": 7,
      "uids": {
        "id": "0cd1a7f8-cee0-4f54-9c6b-534c123f2ec6"
      }
    },
    {
      "file_links": [],
      "name": "Abstract Butter",
      "notes": "Shortening for making rich, buttery baked goods",
      "process": {
        "id": "b8f748cf-c313-4f2c-8e38-84d7701f9609",
        "scope": "id",
        "type": "link_by_uid"
      }
    }
  ]
}
Anirudh Vyas
@AnirudhVyas

by a lot of work I meant lot of I/O

I am answering my question - to do what I needed (transform a product type to JObject directly -> http://json4s.org/ use decompose)

Markus
@mnotti
Hi, wondering if there's an idiomatic/easy way to write a JObject to a file?
Anirudh Vyas
@AnirudhVyas
Unsure about file - but I have used jackson.Serialization.write before to transform to a string and then perhaps to a file, but if someone else knows of a cleaner way all ears 👂
Greg Zoller
@gzoller
G'day... is there a json4s build against dotty?
Sankarshan Mudkavi
@Sankarshan-Mudkavi
Hey guys, does json4s support parsing and extraction in an akka stream? It seems to be hanging on the first object every time. I'm using JSONframing to stream the json objects from a filestream
Qubiq1337
@Qubiq1337
Hey guys, how to pop/remove value from json?
Anirudh Vyas
@AnirudhVyas
 val originalRequestWithoutRequestId = wc.originalRequest.removeField {
      case ("blah_field_name", _) => true
      case ("another_blah_field_name", _) => true
      case _                 => false
    }
@Qubiq1337 ^^
Qubiq1337
@Qubiq1337
Ty
Anirudh Vyas
@AnirudhVyas
@gzoller dotty is not stable yet ... unsure why there would until they finalize everything?
Pavel Zorin
@pazone

Hi folks. How do I filter off objects from a json array?
For example:

  {
    "name": "John"
  },
  {
    "name": "Joseph"
  },
  {
    "name": "Peter"
  }
]

I'd like to filter off objects with names which are not starting with Jo:

  {
    "name": "John"
  },
  {
    "name": "Joseph"
  }
]

The result might be a String or JValue with json array inside.
Thanks.

Anirudh Vyas
@AnirudhVyas
JArray(List.empty).map { case JObject(values) => JObject(values.filter { case (fName, _) => fName.startsWith("Jo") }) } would something like this work?
Pavel Zorin
@pazone
Wow! Thanks. I'll try it
Jack Koenig
@jackkoenig
Is there a way to not error on Exception in thread "main" org.json4s.package$MappingException: Do not know how to serialize key of type class my.custom.Type. Consider implementing a CustomKeySerializer., like a low-priority custom serializer that turns the error into a String in the emitted JSON or something?
Rohan Sircar
@rohan-sircar
Messed up the formatting. Reposting with correct formatting -
class MyJInstantSerializer
    extends CustomSerializer[Instant](format =>
      (
        {
          // case JInt(d) => Instant.ofEpochMilli(d.toLong)
          case JString(d) => Instant.parse(d)
          case JNull      => null
        }, {
          // case d: Instant => JInt(d.toEpochMilli)
          case d: Instant => JString(d.toString())
        }
      )
    )
Thomas Järvstrand
@tjarvstrand
Hi! Is this room still active? I was wondering if there are any plans to release 3.7.0 soon?
Andy Czerwonka
@andyczerwonka
I noticed that TypeHints trait method classFor changed it's signature. Can someone point me to the new API docs or release notes for this breaking change?
Thomas Järvstrand
@tjarvstrand
@andyczerwonka I'm not sure if there are any. If it helps, here's the PR: https://github.com/json4s/json4s/pull/732/files
Basically the type hint now needs to know a common parent class to be able disambiguate between hints with the same name
Saad Khawaja
@SaadKhawaja
json4s-core_3.0.0-RC2 is missing in maven central, when will it be available? Thanks.
Thomas Järvstrand
@tjarvstrand
@SaadKhawaja I'd open an issue on github. Unfortunately I don't think any of the maintainers watch this channel
Saad Khawaja
@SaadKhawaja
@tjarvstrand Thanks I did here json4s/json4s#784
ankusharya
@ankusharya
What is the coordinate for scala-native json4s library? Can anyone guide me? Thanks
Thomas Järvstrand
@tjarvstrand
@ankusharya Looks like it should be "org.json4s" % s"json4s-native_$scalaNativeVersion" % json4sVersion. You can find it here: https://search.maven.org/search?q=json4s-native
Noah Zucker
@noahlz
Hello! I see that 3.7.0 is in the works - is the Milestone release suitable for production use?
I saw a commit made referencing my issue json4s/json4s#771
Andriy Plokhotnyuk
@plokhotnyuk
@noahlz I would double think before using of latest json4s releases and milestones in case of accepting untrusted input through them.
Noah Zucker
@noahlz
Double think? You mean.. think twice until these are fixed?
DavidGoodenough
@DavidGoodenough
I have code that used to work in scala-2 but when I move to 3.0.0rc3 it complains that // is not a member of JValue. Any ideas?
Nadav Samet
@thesamet
Is json4s-jackson for Scala 3 in scope for 3.7.0 - I see that it's currently disabled in the build.