@@ -82,7 +82,7 @@ spec = describe "Servant.Docs" $ do
82
82
(defAction & notes <>~ [DocNote " Get an Integer" [" get an integer in Json or plain text" ]])
83
83
<>
84
84
extraInfo
85
- (Proxy :: Proxy (" postJson " :> ReqBody '[JSON ] String :> Post '[JSON ] Datatype1 ))
85
+ (Proxy :: Proxy (ReqBody '[JSON ] String :> Post '[JSON ] Datatype1 ))
86
86
(defAction & notes <>~ [DocNote " Post data" [" Posts some Json data" ]])
87
87
md = markdown (docsWith defaultDocOptions [] extra (Proxy :: Proxy TestApi1 ))
88
88
tests1 md
@@ -126,10 +126,10 @@ spec = describe "Servant.Docs" $ do
126
126
md `shouldContain` " ## GET"
127
127
128
128
it " should mention the endpoints" $ do
129
- md `shouldContain` " ## POST /postJson "
129
+ md `shouldContain` " ## POST /"
130
130
md `shouldContain` " ## GET /qparam"
131
131
md `shouldContain` " ## GET /qparamform"
132
- md `shouldContain` " ## PUT /header "
132
+ md `shouldContain` " ## PUT /"
133
133
134
134
it " mentions headers" $ do
135
135
md `shouldContain` " - This endpoint is sensitive to the value of the **X-Test** HTTP header."
@@ -145,7 +145,7 @@ spec = describe "Servant.Docs" $ do
145
145
md `shouldContain` " ### GET Parameters:"
146
146
md `shouldContain` " - query"
147
147
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*"
149
149
150
150
it " does not generate any docs mentioning the 'empty-api' path" $
151
151
md `shouldNotContain` " empty-api"
@@ -178,11 +178,12 @@ instance MimeRender PlainText Int where
178
178
mimeRender _ = cs . show
179
179
180
180
type 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
182
184
:<|> " qparam" :> QueryParam " query" String :> Get '[JSON ] Datatype1
183
185
:<|> " qparamform" :> QueryParamForm Datatype1 :> Get '[JSON ] Datatype1
184
- :<|> " header" :> Header " X-Test" Int :> Put '[JSON ] Int
185
- :<|> " empty-api" :> EmptyAPI
186
+
186
187
187
188
type TestApi2 = " duplicate-endpoint" :> Get '[JSON ] Datatype1
188
189
:<|> " duplicate-endpoint" :> Get '[PlainText ] Int
0 commit comments