json-lenses
json-lenses copied to clipboard
Spray-routing issue?
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 {
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.