Default parameter support for JSON extraction (Scala 2.8) #534

Open
jonifreeman opened this Issue May 24, 2010 · 3 comments

Comments

Projects
None yet
4 participants
Member

jonifreeman commented May 24, 2010

case class Bike(make: String = "Trek", price: Int)
parse("""{"price": 350}""" ).extract[Bike]

should give: Bike("Trek", 350)

jonifreeman was assigned Mar 1, 2012

adam00s commented Nov 22, 2012

It would be very nice to have this feature.

Owner

Shadowfiend commented May 10, 2014

While this is theoretically doable, it would be very hacky (see http://stackoverflow.com/questions/14034142/how-do-i-access-default-parameter-values-via-scala-reflection ) unless/until scala.reflect becomes a little more stable and adds support for default parameters (see https://issues.scala-lang.org/browse/SI-6468).

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