@@ -82,7 +82,7 @@ spec = describe "Servant.Docs" $ do
8282 (defAction & notes <>~ [DocNote " Get an Integer" [" get an integer in Json or plain text" ]])
8383 <>
8484 extraInfo
85- (Proxy :: Proxy (" postJson " :> ReqBody '[JSON ] String :> Post '[JSON ] Datatype1 ))
85+ (Proxy :: Proxy (ReqBody '[JSON ] String :> Post '[JSON ] Datatype1 ))
8686 (defAction & notes <>~ [DocNote " Post data" [" Posts some Json data" ]])
8787 md = markdown (docsWith defaultDocOptions [] extra (Proxy :: Proxy TestApi1 ))
8888 tests1 md
@@ -126,10 +126,10 @@ spec = describe "Servant.Docs" $ do
126126 md `shouldContain` " ## GET"
127127
128128 it " should mention the endpoints" $ do
129- md `shouldContain` " ## POST /postJson "
129+ md `shouldContain` " ## POST /"
130130 md `shouldContain` " ## GET /qparam"
131131 md `shouldContain` " ## GET /qparamform"
132- md `shouldContain` " ## PUT /header "
132+ md `shouldContain` " ## PUT /"
133133
134134 it " mentions headers" $ do
135135 md `shouldContain` " - This endpoint is sensitive to the value of the **X-Test** HTTP header."
@@ -145,7 +145,7 @@ spec = describe "Servant.Docs" $ do
145145 md `shouldContain` " ### GET Parameters:"
146146 md `shouldContain` " - query"
147147 it " mentions optional query-param-form params from QueryParamForm" $
148- md `shouldContain` " - **Values**: *dt1field1=field%201&dt1field2=13 *"
148+ md `shouldContain` " **Values**: *dt1field2=13& dt1field1=field%201*"
149149
150150 it " does not generate any docs mentioning the 'empty-api' path" $
151151 md `shouldNotContain` " empty-api"
@@ -178,11 +178,12 @@ instance MimeRender PlainText Int where
178178 mimeRender _ = cs . show
179179
180180type TestApi1 = Get '[JSON , PlainText ] (Headers '[Header " Location" String ] Int )
181- :<|> " postJson" :> ReqBody '[JSON ] String :> Post '[JSON ] Datatype1
181+ :<|> ReqBody '[JSON ] String :> Post '[JSON ] Datatype1
182+ :<|> Header " X-Test" Int :> Put '[JSON ] Int
183+ :<|> " empty-api" :> EmptyAPI
182184 :<|> " qparam" :> QueryParam " query" String :> Get '[JSON ] Datatype1
183185 :<|> " qparamform" :> QueryParamForm Datatype1 :> Get '[JSON ] Datatype1
184- :<|> " header" :> Header " X-Test" Int :> Put '[JSON ] Int
185- :<|> " empty-api" :> EmptyAPI
186+
186187
187188type TestApi2 = " duplicate-endpoint" :> Get '[JSON ] Datatype1
188189 :<|> " duplicate-endpoint" :> Get '[PlainText ] Int
0 commit comments