Merge pull request #813 from ivan-m/response-content-type
List content type with response examples
commit4a6edd786495a033262d47512838f7988549f3c6
authorAlp Mestanogullari <alpmestan@gmail.com>
dateMon 25 Sep 2017, 10:38 (9 years ago)
parent28fe7a081184df
servant-docs/CHANGELOG.md+1
@@ -6,6 +6,7 @@
66* Add a markdown header for the Headers an endpoint is sensitive to.
77* Document the HTTP Method the parameters of an endpoint belong to
88 (rather than assuming `GET` for all of them).
9+* Content type of sample response body is also displayed.
910
10110.11
1112----
servant-docs/src/Servant/Docs/Internal.hs+1−1
@@ -674,7 +674,7 @@ markdown api = unlines $
674674 [] -> ["- No response body\n"]
675675 [("", t, r)] -> "- Response body as below." : contentStr t r
676676 xs ->
677− concatMap (\(ctx, t, r) -> ("- " <> T.unpack ctx) : contentStr t r) xs
677+ concatMap (\(ctx, t, r) -> ("- " <> T.unpack ctx <> " (`" <> cs (show t) <> "`)") : contentStr t r) xs
678678
679679-- * Instances
680680