에 대한 파생되지 Http4s EntityDecoder이 오류가 점점 오전 :자동 간단한 경우 클래스
case req @ POST -> Root/"v1"/"profiles" =>
req.as[UserProfile] flatMap {(up: UserProfile) =>
Ok(service.createProfile(up).asJson)
}
:
case class UserProfile(id: Option[Int], firstName: String, lastName: String)
이 POST
코드에 오류가 발생했습니다 : 다음과 같은 경우 클래스
Cannot decode into a value of type com.blah.rest.model.UserProfile,
because no EntityDecoder[cats.effect.IO, com.blah.rest.model.UserProfile]
instance could be found.
을
다음과 같이 POST
본문 :
{
"firstName": "Jack",
"lastName": "Appleseed"
}
본체가 req.as[UserProfile]
으로 변환 될 때 발생한다고 생각합니다!
그러나 이것은 일반 바닐라 케이스 클래스이며 EntityDecoder
은 자동으로 파생되어야합니다! 나는 akka-http
을 알고있다!
아이디어가 있습니까?
은 참고 사항 :Http4sVersion = "0.18.0-M4"
및
circe version "0.9.0-M1"