on master help sign in
Changed to adding a Headers header
a2c6ef7Ivan Lazar Miljenovic
servant-docs/src/Servant/Docs/Internal.hs+7−2
@@ -525,10 +525,10 @@ markdown api = unlines $
525 printEndpoint endpoint action =
525 printEndpoint endpoint action =
526 str :
526 str :
527 "" :
527 "" :
528− headersStr (action ^. headers) ++
529 notesStr (action ^. notes) ++
528 notesStr (action ^. notes) ++
530 authStr (action ^. authInfo) ++
529 authStr (action ^. authInfo) ++
531 capturesStr (action ^. captures) ++
530 capturesStr (action ^. captures) ++
531+ headersStr (action ^. headers) ++
532 paramsStr (action ^. params) ++
532 paramsStr (action ^. params) ++
533 rqbodyStr (action ^. rqtypes) (action ^. rqbody) ++
533 rqbodyStr (action ^. rqtypes) (action ^. rqbody) ++
534 responseStr (action ^. response) ++
534 responseStr (action ^. response) ++
@@ -588,7 +588,12 @@ markdown api = unlines $
588
588
589 headersStr :: [Text] -> [String]
589 headersStr :: [Text] -> [String]
590 headersStr [] = []
590 headersStr [] = []
591+ headersStr l =
592+ "#### Headers:" :
593+ "" :
591− headersStr l = [""] ++ map headerStr l ++ [""]
594+ map headerStr l ++
595+ "" :
596+ []
592
597
593 where headerStr hname = "- This endpoint is sensitive to the value of the **"
598 where headerStr hname = "- This endpoint is sensitive to the value of the **"
594 ++ unpack hname ++ "** HTTP header."
599 ++ unpack hname ++ "** HTTP header."