git.iko.soy/typeable/servant
on master help sign in
Merge pull request #332 from haskell-servant/jkarni/fix-doc-headers

Fix extra quotes in Verb headers for docs.

commita957fefbd245bd134c2ee6a2abb5586081432178 authorJulian Arni <jkarni@gmail.com> dateSat 16 Jan 2016, 17:59 (11 years ago) parente7b80e9641431d
2 files changed+5−4
servant-docs/src/Servant/Docs/Internal.hs+2−1 servant-docs/test/Servant/DocsSpec.hs+3−3
servant-docs/src/Servant/Docs/Internal.hs+2−1
@@ -27,6 +27,7 @@ import Control.Lens (makeLenses, over, traversed, (%~),
2727import qualified Control.Monad.Omega as Omega
2828import Data.ByteString.Conversion (ToByteString, toByteString)
2929import Data.ByteString.Lazy.Char8 (ByteString)
30+import qualified Data.ByteString.Char8 as BSC
3031import qualified Data.CaseInsensitive as CI
3132import Data.Hashable (Hashable)
3233import Data.HashMap.Strict (HashMap)
@@ -522,7 +523,7 @@ markdown api = unlines $
522523 responseStr (action ^. response) ++
523524 []
524525
525− where str = "## " ++ show (endpoint^.method)
526+ where str = "## " ++ BSC.unpack (endpoint^.method)
526527 ++ " " ++ showPath (endpoint^.path)
527528
528529 introsStr :: [DocIntro] -> [String]
servant-docs/test/Servant/DocsSpec.hs+3−3
@@ -73,9 +73,9 @@ spec = describe "Servant.Docs" $ do
7373 it "mentions status codes" $ do
7474 md `shouldContain` "Status code 200"
7575
76− it "mentions methods" $ do
77− md `shouldContain` "POST"
78− md `shouldContain` "GET"
76+ it "has methods as section headers" $ do
77+ md `shouldContain` "## POST"
78+ md `shouldContain` "## GET"
7979
8080 it "mentions headers" $ do
8181 md `shouldContain` "- This endpoint is sensitive to the value of the **X-Test** HTTP header."