-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Added default value support #439
Conversation
ed96d11
to
f83bb10
Compare
The build failure occurs on the 2.11 branch without this change. Should this change be made to the 2.11 branch? I didn't make it on the master branch because that doesn't even compile. Would the 2.10 branch be better? |
f83bb10
to
2fb5d63
Compare
One thing about this change, if you have: case class Foo(bar: Option[String] = Some("bar")) And you don't pass |
master branch is for the 3.0 release and it needs plenty of work to get all the tests to pass. 2.11 branch is the best place to start. The build was passing last month but it does seem to be broken now. It might be a few days before I can investigate the issue. |
@cowtowncoder do you know of any changes in jackson-databind 2.11.0-SNAPSHOT that could be causing this? The tests were passing a month ago and no jackson-module-scala have been done.
|
case std: StdValueInstantiator => | ||
new ScalaValueInstantiator(std, config, descriptor) | ||
case other => | ||
throw new IllegalArgumentException("Cannot customise a non StdValueInstantiatiator: " + other.getClass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Kotlin module does exactly the same thing here, and it's been doing that for 4 years presumably with no problems, so I think we're fine to fail too:
@pjfanning Can not think of anything specific that would trigger such a failure, offhand. :-( |
the existing jackson-module-scala 2.11 branch tests pass when run against jackson-databind 2.10.1 @cowtowncoder I rebuilt various versions of jackson-databind 2.11.0-SNAPSHOT with the code from various days and it appears it is the changes on 2.11 on Nov 9th that have caused the jackson-module-scala tests to fail for the scala Either[L, R] type. |
Thanks! Should I submit another PR to forward port to master? And is there any chance this could be backported to 2.10.x or will we wait for 2.11? |
@jroper this does affect existing users, who might have case classes with default values but rely on the fact that jackson does not support this - could we make the behaviour configurable? If it was configurable, then it could disabled by default in the 2.10 backport and enabled by default in 2.11. |
@jroper when ported to master branch, the unit test has never seemed to work - the master branch is for the yet-to-be-released jackson v3. Your code works well in jackson v2. If you have time would you be able to look at the issue in master? The test is currently commented out. The issue could be a mistake I made when porting the code but I can't see anything obvious. |
Fixes #87