Closed djx314 closed 9 years ago
Thx! I'll check it out in a week or two. Busy right now.
I guess it has something to do with https://playframework.com/documentation/2.4.x/Migration24#Reading-Options
It looks like you can use the removed OptionReads
from https://github.com/playframework/playframework/commit/4fa5d3b2e4e9edf66dcfc51a9e15af3c19f08268, but it's not ideal...
Asked @jroper on twitter, what he recommends: https://twitter.com/cvogt/status/605735633252970496
You are right about the change being the problem, but the guide doesn't describe a solution for arbitrary structures containing Options in multiple arbitrary places. That would be a problem for many people I suppose. They probably have a solution in store, but not documented.
+1
Migrating to 2.4 and this caused me a lot of trouble and I ended up solving it by using the removed OptionReads
, which feels really bad to me. However, I guess it'll work until a better solution is provided.
+1
published 0.3.0-SNAPSHOT for play-json 2.4.1. please try if it works for you guys.
0.3.0 also comes with extension methods for JsValue and JsLookupResult validateAuto
that automatically uses validate or validateOpt as appropriate, validateOpt
that handles options (will be built in play-json in the next release)
fixed in release 0.3.0
To use options in your code use
import org.cvogt.test.play.json.implicits.optionWithNull // play 2.4 suggested behavior
or
import org.cvogt.test.play.json.implicits.optionNoError // play 2.3 behavior
0.3.0
seems to work!
Thanks!
When I checkout the master and change
to
and test. But it compile failed.
And in play-json 2.3.8 it builds successed.