From 81184df3d4361053a54edbf73de2e583f43d3281 Mon Sep 17 00:00:00 2001 From: Ivan Lazar Miljenovic Date: Fri, 22 Sep 2017 14:11:28 +1000 Subject: [PATCH] List content type with response examples --- servant-docs/CHANGELOG.md | 1 + servant-docs/src/Servant/Docs/Internal.hs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/servant-docs/CHANGELOG.md b/servant-docs/CHANGELOG.md index c239a5b4..1573e31f 100644 --- a/servant-docs/CHANGELOG.md +++ b/servant-docs/CHANGELOG.md @@ -6,6 +6,7 @@ * Add a markdown header for the Headers an endpoint is sensitive to. * Document the HTTP Method the parameters of an endpoint belong to (rather than assuming `GET` for all of them). +* Content type of sample response body is also displayed. 0.11 ---- diff --git a/servant-docs/src/Servant/Docs/Internal.hs b/servant-docs/src/Servant/Docs/Internal.hs index caf06365..bad26875 100644 --- a/servant-docs/src/Servant/Docs/Internal.hs +++ b/servant-docs/src/Servant/Docs/Internal.hs @@ -674,7 +674,7 @@ markdown api = unlines $ [] -> ["- No response body\n"] [("", t, r)] -> "- Response body as below." : contentStr t r xs -> - concatMap (\(ctx, t, r) -> ("- " <> T.unpack ctx) : contentStr t r) xs + concatMap (\(ctx, t, r) -> ("- " <> T.unpack ctx <> " (`" <> cs (show t) <> "`)") : contentStr t r) xs -- * Instances