Sunday, 15 August 2010

scala - Could not find implicit Marshaller in Spray.io when using Jackson -



scala - Could not find implicit Marshaller in Spray.io when using Jackson -

i have spray.io directive handles post , want utilize jerkson (scala interface jackson) parse incoming json appropriate class.

post { path("") { entity(as[string]) { stuff => finish { parse[user](stuff) } } } }

the issue when go compile, spray goes looking marshaller:

[error] c:\project\src\main\scala\com\project\accountservice\controllers\users.scala:53: not find implicit value evidence parameter of type spray.httpx.marshalling.marshaller[com.project.accountservice.models.user] [error] parse[user](stuff) [error] ^ [error] 1 error found

do need write custom marhsaller this? or directive not written properly? , if need one, examples out there?

thanks!

this managed job done:

post { path("") { entity(as[string]) { body => val user = parse[user](body) complete(generate(user)) } } }

looks since wasn't returning string in complete started looking marshaller marshall user object.

scala spray spray-json jerkson

No comments:

Post a Comment