Akka-HTTPで公式にサポートされているJSONライブラリのspray-jsonの使い方。 JSON Support — Akka Documentation Akka-HTTPと一緒に使いたいので、Marshaller/Unmarshallerとして使用法も載せる。 tl;dr クラスのフィールドに独自の型を使わない場合 or 独自の型に対応させてjsonを入れ子にする場合 jsonFormatNを使えば手軽で良い クラスのフィールドとjsonのフォーマットを変えたい場合 RootJsonProtocolを一生懸命実装する Akka-HTTPではSprayJsonSupportをextendsすればimplicitにやってくれる akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport 基本的な使い方 case classをj