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