devoxx / CallForPapers

The Devoxx Call For Papers
Other
1 stars 0 forks source link

'No Json serializer' error by Scala compiler when a serialiser for 'models.Speaker' does exists #15

Open neomatrix369 opened 6 years ago

neomatrix369 commented 6 years ago

Just raising this issue for documentation and knowledge sharing purposes.

I was changing Speaker.scala to enable some archiving features in it.

See my changes that I initially tried: https://gist.github.com/neomatrix369/5d21d89adf97b99a03d7fc2506496cd6

Running this gives me this strange compilation error:

screen-shot-scala-compiler-error

I noticed the cause of the error were the two functions: checkIfSpeakerHasBeenArchived() and checkIfSpeakerQandAHasBeenArchived() in https://gist.github.com/neomatrix369/5d21d89adf97b99a03d7fc2506496cd6.

It's what the two functions are doing, they are trying to read off Redis and compare values. When I get rid of these functions and clean compile the rest of the code works without any complains.

Would you know what I'm doing wrong? Is the above compilation error is a red-herring (the problem may be somewhere else).

Any advice will be helpful - maybe you could try out my changes and see what happens.

neomatrix369 commented 6 years ago

I did raise it with @nicmarti and @stephanj, @nicmarti advise as follows:

Look at the Json documentation in Play, you need to implement an implicit reader or writer. However there is already one in the Speaker companion object. Import this into the action and it will work

Else look at the rest API, there are samples their


I intend to investigate this further using the above, if anyone else has other hints, its most welcome.