I recently came across an issue when I had used `parameters(…)` with custom 
unmarshalling and a default value. I found that 
`parameters(“foo”.as[MyType] ?)` compiles, but the following did not: 
`parameters(“foo”.as[MyType] ? MyType.default)`. The compiler says that 
there are "too many parameters for method 'parameters(...' The only thing 
that seemed to compile was placing a string on the right side of the `?` 
instead of a concrete type. This took me about two hours to figure out 
because it was not apparent in the documentation: 
http://doc.akka.io/docs/akka/2.4/scala/http/routing-dsl/directives/parameter-directives/parameters.html

 

Note, knowing that `parameters(“foo” ? 0)` works for an Int, I tried the 
following to no avail, thinking that the type could be inferred correctly 
and unmarshalled: `parameters(“foo” ? MyType.default)`.

 

I would suggest an update to the referenced documentation to give an 
example for using a default value while using a custom unmarshaller. Any 
enlightenment on the reason for this, or if I am missing something, would 
be super helpful! Thanks!

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to