Merge pull request #332 from haskell-servant/jkarni/fix-doc-headers

Fix extra quotes in Verb headers for docs.
This commit is contained in:
Julian Arni 2016-01-16 17:59:04 +01:00
commit a957fefbd2
2 changed files with 5 additions and 4 deletions

View file

@ -27,6 +27,7 @@ import Control.Lens (makeLenses, over, traversed, (%~),
import qualified Control.Monad.Omega as Omega import qualified Control.Monad.Omega as Omega
import Data.ByteString.Conversion (ToByteString, toByteString) import Data.ByteString.Conversion (ToByteString, toByteString)
import Data.ByteString.Lazy.Char8 (ByteString) import Data.ByteString.Lazy.Char8 (ByteString)
import qualified Data.ByteString.Char8 as BSC
import qualified Data.CaseInsensitive as CI import qualified Data.CaseInsensitive as CI
import Data.Hashable (Hashable) import Data.Hashable (Hashable)
import Data.HashMap.Strict (HashMap) import Data.HashMap.Strict (HashMap)
@ -522,7 +523,7 @@ markdown api = unlines $
responseStr (action ^. response) ++ responseStr (action ^. response) ++
[] []
where str = "## " ++ show (endpoint^.method) where str = "## " ++ BSC.unpack (endpoint^.method)
++ " " ++ showPath (endpoint^.path) ++ " " ++ showPath (endpoint^.path)
introsStr :: [DocIntro] -> [String] introsStr :: [DocIntro] -> [String]

View file

@ -73,9 +73,9 @@ spec = describe "Servant.Docs" $ do
it "mentions status codes" $ do it "mentions status codes" $ do
md `shouldContain` "Status code 200" md `shouldContain` "Status code 200"
it "mentions methods" $ do it "has methods as section headers" $ do
md `shouldContain` "POST" md `shouldContain` "## POST"
md `shouldContain` "GET" md `shouldContain` "## GET"
it "mentions headers" $ do it "mentions headers" $ do
md `shouldContain` "- This endpoint is sensitive to the value of the **X-Test** HTTP header." md `shouldContain` "- This endpoint is sensitive to the value of the **X-Test** HTTP header."