Got it! Sorry for the spam:
implicit def defaultUrlEncodedFormDataUnmarshaller(implicit fm:
FlowMaterializer): FromEntityUnmarshaller[FormData]
FYI: To find this I had to create fake methods with the implicit parameters
required from the code (e.g. def x()(implicit a: FromEntityUnmarshaller
[StrictForm], b:FromStrictFormFieldUnmarshaller[String]) = ???)
and follow the implicit calls using the ide. Is there a better way to do
this?
Thanks again
G
On Wednesday, 27 May 2015 09:29:22 UTC+2, Giovanni Alberto Caporaletti
wrote:
>
> Well, since I'm here, let me ask: all the marshalling code requires an
> execution context (I can see that), but why a materializer? I can't find
> where the implicit mat is needed anywhere
>
> Thanks
> G
>
> On Wednesday, 27 May 2015 09:21:37 UTC+2, Giovanni Alberto Caporaletti
> wrote:
>>
>> You need both an implicit FlowMaterializer and an implicit
>> ExecutionContext in scope. I haven't followed the chain to check why those
>> are needed but basically I keep adding them (one or the other or both)
>> wherever I have compilation errors and it works. It should be something
>> related to marshalling, I'll leave the answer to the more expert guys
>> around here.
>>
>> val route =
>> extractFlowMaterializer { implicit mat =>
>> implicit val ec = mat.executionContext
>> formFields('color, 'age.as[Int]) { (color, age) =>
>> complete(s"The color is '$color' and the age ten years ago was ${age -
>> 10}")
>> }
>> }
>>
>>
>> On Tuesday, 26 May 2015 14:35:12 UTC+2, Ian Phillips wrote:
>>>
>>> If I try to follow the example from the documentation it doesn't compile.
>>>
>>> val route =
>>> formFields('color, 'age.as[Int]) { (color, age) =>
>>> complete(s"The color is '$color' and the age ten years ago was
>>> ${age - 10}")
>>> }
>>>
>>>
>>> I get the following error:
>>>
>>> too many arguments for method formFields: (pdm:
>>> akka.http.scaladsl.server.directives.FormFieldDirectives.FieldMagnet)pdm.Out
>>> formFields('color, 'age.as[Int]) { (color, age) =>
>>> ^
>>> one error found
>>>
>>> Is the documentation wrong, or (more likely) what stupid mistake am I
>>> making with this? In case it makes a difference here, I'm importing:
>>>
>>> import akka.http.scaladsl.server._
>>> import akka.http.scaladsl.server.Directives._
>>>
>>>
>>> Cheers,
>>> Ian.
>>>
>>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.