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

Odd incorrect encoding of heterogenous map #55

Closed
tylerprete opened this issue Sep 2, 2015 · 2 comments · Fixed by #87
Closed

Odd incorrect encoding of heterogenous map #55

tylerprete opened this issue Sep 2, 2015 · 2 comments · Fixed by #87
Assignees

Comments

@tylerprete
Copy link

With circe 0.1.1, I'm running the following program:

import io.circe._
import io.circe.generic.auto._
import io.circe.jawn._
import io.circe.syntax._

object Main {
  def main(args: Array[String]) {
    val funnyMap1 = Map("a" -> Map("str" -> "b", "map" -> Map("d" -> 1)))
    val weirdJs1 = funnyMap1.asJson.noSpaces 

    println(weirdJs1)
  }
}

With the result:

{"a":{"str":{},"map":{}}}
@alexarchambault
Copy link
Contributor

Seems related to milessabin/shapeless#453. The second map (Map("str" -> "b", "map" -> Map("d" -> 1))) is inferred as Map[String, Object], and Object happens to have a (defective) Generic because of milessabin/shapeless#453.

@travisbrown
Copy link
Member

Thanks for catching this, @tylerprete! That definitely shouldn't compile, and I've created #57 to track new tests that will verify that.

@travisbrown travisbrown self-assigned this Nov 4, 2015
julienrf pushed a commit to scalacenter/circe that referenced this issue May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants