Handle request/response bodies with empty titles
This commit is contained in:
parent
a21beadf86
commit
ed3ace3066
1 changed files with 5 additions and 1 deletions
|
@ -719,11 +719,15 @@ markdownWith RenderingOptions{..} api = unlines $
|
|||
|
||||
formatBody :: (Text, NonEmpty M.MediaType, ByteString) -> [String]
|
||||
formatBody (t, ms, b) =
|
||||
"- " <> cs t <> " (" <> mediaList ms <> "):" :
|
||||
"- " <> title <> " (" <> mediaList ms <> "):" :
|
||||
contentStr (NE.head ms) b
|
||||
where
|
||||
mediaList = fold . NE.intersperse ", " . fmap (\m -> "`" ++ show m ++ "`")
|
||||
|
||||
title
|
||||
| T.null t = "Example"
|
||||
| otherwise = cs t
|
||||
|
||||
markdownForType mime_type =
|
||||
case (M.mainType mime_type, M.subType mime_type) of
|
||||
("text", "html") -> "html"
|
||||
|
|
Loading…
Reference in a new issue