Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extraction always yield empty JObject if loaded AFTER scalatest 3.2.10 #1082

Open
tribbloid opened this issue Jun 11, 2022 · 1 comment
Open

Comments

@tribbloid
Copy link

(Original post:)

https://stackoverflow.com/questions/72587978/in-json4s-why-does-the-extract-function-always-yield-empty-object-result

Here is a simple example:

  implicit val formats: Formats = DefaultFormats

  case class StrInt(
      a: String = "A",
      b: Int = 2
  )


    val d1 = StrInt("a", 12)
    val json = decompose(d1)
    
    println(json)

The result of the above code is JObject(Nil). Instead off a JObject with 2 fields.

It was discovered when migrating my tests from maven to gradle, of which classloader loads test dependency before main jars. Thus producing the above result. Otherwise the problem won't manifest

json4s version

3.5.5

scala version

2.12.16

jdk version

OpenJDK 1.8

@tribbloid
Copy link
Author

same bug encountered on v3.6.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant