=doc,htc better example docs on mapping error response to empty JSON body

This commit is contained in:
Konrad Malawski 2015-11-24 12:02:20 +01:00
parent ce2d666c06
commit 05ab43f824
2 changed files with 52 additions and 2 deletions

View file

@ -18,8 +18,14 @@ was generated by the inner route. This directive transforms complete responses.
See also :ref:`-mapResponseHeaders-` or :ref:`-mapResponseEntity-` for more specialized variants and
:ref:`Response Transforming Directives` for similar directives.
Example
-------
Example: Override status
------------------------
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala
:snippet: 0mapResponse
Example: Default to empty JSON response on errors
-------------------------------------------------
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala
:snippet: 1mapResponse-advanced