JSON handling in akka-http.
Marshaller and Unmarshaller
- Marshalling
- Unmarshalling
- JSON Support (
SprayJsonSupport
by default) - Marshalling & Unmarshalling (in routing DSL)
3rd parties
akka-http-json
Custom JSON (un)marshaller for akka-http by using 3rd party libraries. The community seems to be very active.
akka-http + Jackson
akka-http + circe
circe's decode[A]
produces Either[Error, A]
but akka-http requires Future[A]
. _.fold(Future.failed, Future.successful)
can be a solution to convert from Either[Throwable, A]
to Future[A]
.
Documents (in Japanese)
- [Akka-HTTP]spray-jsonの使い方とAkka-HTTP
- Akka-HTTPを型で縛る (Bind Akka-HTTP by types)
- Akka HTTPでJacksonを使ってJSON変換をする