diff --git a/akka-docs/rst/scala/code/docs/http/scaladsl/SprayJsonExampleSpec.scala b/akka-docs/rst/scala/code/docs/http/scaladsl/SprayJsonExampleSpec.scala index 7da0505134..187290eed0 100644 --- a/akka-docs/rst/scala/code/docs/http/scaladsl/SprayJsonExampleSpec.scala +++ b/akka-docs/rst/scala/code/docs/http/scaladsl/SprayJsonExampleSpec.scala @@ -4,8 +4,6 @@ package docs.http.scaladsl -import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport -import akka.http.scaladsl.server.Directives import org.scalatest.{ Matchers, WordSpec } class SprayJsonExampleSpec extends WordSpec with Matchers { @@ -13,7 +11,9 @@ class SprayJsonExampleSpec extends WordSpec with Matchers { def compileOnlySpec(body: => Unit) = () "spray-json example" in compileOnlySpec { - //#example + //#minimal-spray-json-example + import akka.http.scaladsl.server.Directives + import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport import spray.json._ // domain model @@ -120,4 +120,4 @@ class SprayJsonExampleSpec extends WordSpec with Matchers { } //#second-spray-json-example } -} \ No newline at end of file +} diff --git a/akka-docs/rst/scala/http/common/json-support.rst b/akka-docs/rst/scala/http/common/json-support.rst index 5c3aab6c47..835a26617d 100644 --- a/akka-docs/rst/scala/http/common/json-support.rst +++ b/akka-docs/rst/scala/http/common/json-support.rst @@ -33,8 +33,8 @@ This is how you enable automatic support for (un)marshalling from and to JSON wi Once you have done this (un)marshalling between JSON and your type ``T`` should work nicely and transparently. -.. includecode:: ../../code/docs/http/scaladsl/SprayJsonExampleSpec.scala - :include: example +.. includecode2:: ../../code/docs/http/scaladsl/SprayJsonExampleSpec.scala + :snippet: minimal-spray-json-example 4. By default, spray-json marshals your types to pretty printed json by implicit conversion using PrettyPrinter, as defined in ``implicit def sprayJsonMarshallerConverter[T](writer: RootJsonWriter[T])(implicit printer: JsonPrinter = PrettyPrinter): ToEntityMarshaller[T]``.