+doc #19796 explain how to obtain a JsValue using entity(as)
This commit is contained in:
parent
61a86556c6
commit
1143b27b89
2 changed files with 25 additions and 1 deletions
|
|
@ -49,3 +49,11 @@ class. It utilizes ``SprayJsonSupport`` via the ``PersonJsonSupport`` object as
|
|||
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/MarshallingDirectivesExamplesSpec.scala
|
||||
:snippet: example-entity-with-json
|
||||
|
||||
It is also possible to use the ``entity`` directive to obtain raw ``JsValue`` ( spray-json_ ) objects, by simply using
|
||||
``as[JsValue]``, or any other JSON type for which you have marshallers in-scope.
|
||||
|
||||
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/MarshallingDirectivesExamplesSpec.scala
|
||||
:snippet: example-entity-with-raw-json
|
||||
|
||||
|
||||
.. _spray-json: https://github.com/spray/spray-json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue