on master help sign in
Fix extra quotes in Verb headers for docs.
641431dJulian K. Arni
servant-docs/src/Servant/Docs/Internal.hs+2−1
@@ -27,6 +27,7 @@ import Control.Lens (makeLenses, over, traversed, (%~),
27import qualified Control.Monad.Omega as Omega
27import qualified Control.Monad.Omega as Omega
28import Data.ByteString.Conversion (ToByteString, toByteString)
28import Data.ByteString.Conversion (ToByteString, toByteString)
29import Data.ByteString.Lazy.Char8 (ByteString)
29import Data.ByteString.Lazy.Char8 (ByteString)
30+import qualified Data.ByteString.Char8 as BSC
30import qualified Data.CaseInsensitive as CI
31import qualified Data.CaseInsensitive as CI
31import Data.Hashable (Hashable)
32import Data.Hashable (Hashable)
32import Data.HashMap.Strict (HashMap)
33import Data.HashMap.Strict (HashMap)
@@ -522,7 +523,7 @@ markdown api = unlines $
522 responseStr (action ^. response) ++
523 responseStr (action ^. response) ++
523 []
524 []
524
525
525− where str = "## " ++ show (endpoint^.method)
526+ where str = "## " ++ BSC.unpack (endpoint^.method)
526 ++ " " ++ showPath (endpoint^.path)
527 ++ " " ++ showPath (endpoint^.path)
527
528
528 introsStr :: [DocIntro] -> [String]
529 introsStr :: [DocIntro] -> [String]
servant-docs/test/Servant/DocsSpec.hs+3−3
@@ -73,9 +73,9 @@ spec = describe "Servant.Docs" $ do
73 it "mentions status codes" $ do
73 it "mentions status codes" $ do
74 md `shouldContain` "Status code 200"
74 md `shouldContain` "Status code 200"
75
75
76− it "mentions methods" $ do
76+ it "has methods as section headers" $ do
77− md `shouldContain` "POST"
77+ md `shouldContain` "## POST"
78− md `shouldContain` "GET"
78+ md `shouldContain` "## GET"
79
79
80 it "mentions headers" $ do
80 it "mentions headers" $ do
81 md `shouldContain` "- This endpoint is sensitive to the value of the **X-Test** HTTP header."
81 md `shouldContain` "- This endpoint is sensitive to the value of the **X-Test** HTTP header."