I have the following case class:
case class Customer(name: String)
That is encoded like this:
class ServiceJsonProtocol extends DefaultJsonProtocol {
implicit val customerProtocol = jsonFormat1(Customer)
}
The problem is that for this code:
val route =
path("customer") {
post {
entity(as[Customer]) {
customer => complete {
customers.add(customer)
s"got customer with name ${customer.name}"
}
}
}
I am getting this:
could not find implicit value for parameter um: akka.http.scaladsl.unmarshalling.FromRequestUnmarshaller[Customer]
[error] entity(as[Customer]) {
What is the issue?
spray-json
, please mention it in your question. Also, take a look at stackoverflow.com/questions/33574176/… – The_Tourist