jrudolph/json-lenses

why examples doas not compile ?

radoslawtwardy opened this issue · 5 comments

When i try;
val authorNames = json.extract {String} (allAuthors)
i get:

 error: could not find implicit value for evidence parameter of type cc.spray.json.lenses.package.Reader{String}

When i try:
val newJson1 = json.update(allAuthors ! set {String} ("John Doe"))
i get:

error: Cannot find JsonWriter or JsonFormat type class for String

// i must replaced [ with { because with [ i cant add properly msg

You need the import

import cc.spray.json.lenses.JsonLenses._

Have you tried that?

I'm closing this, since you are the only one who ever complained about this issue and I couldn't reproduce it.

OP should double check the following imports exist:

import spray.json._
import DefaultJsonProtocol._
import lenses.JsonLenses._

adding import
import DefaultJsonProtocol._
have helped me with the same problem