Fix extra quotes in Verb headers for docs.

Fixes #325.
This commit is contained in:
Julian K. Arni 2016-01-15 12:17:48 +01:00
parent a3339f11bf
commit 641431d5b2
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."