json-lenses icon indicating copy to clipboard operation
json-lenses copied to clipboard

Spray-routing issue?

Open analytically opened this issue 11 years ago • 1 comments

When using JSON-Lenses within Spray-routing, I get the following error:

[error]  found   : Symbol
[error]  required: ?{def ?: ?}
[error] Note that implicit conversions are not applicable because they are ambiguous:
[error]  both method symbol2NR in trait ToNameReceptaclePimps of type (symbol: Symbol)spray.routing.directives.NameReceptacle[String]
[error]  and method strToPossiblyOptionalField in object JsonLenses of type (sym: Symbol)spray.json.lenses.JsonLenses.OptionalFieldBuilder
[error]  are possible conversion functions from Symbol to ?{def ?: ?}
[error]                       {json.extract[String]('parties / 'person / filter('id.is[String](_ == id)) / 'firstName)}{json.extract[String]('parties / 'person / filter('id.is[String](_ == id)) / 'lastName)}{json.extract[String]('parties / 'person / filter('id.is[String](_ == id)) / 'organisationName.?).headOption match {

analytically avatar Aug 02 '13 21:08 analytically

Thanks for reporting. Not so sure what to do to fix that properly. As a workaround you could construct the lenses outside of a place where symbol2NR is in scope.

jrudolph avatar Aug 05 '13 10:08 jrudolph