git.iko.soy/typeable/servant
on master help sign in
Fixed docs for NoContent endpoints
commit0ec5af11f5b47bdf5e9f4a755947bdf8e99d25fd authorCatherine Galkina <anais94@yandex.ru> dateSat 7 Sep 2019, 18:14 (7 years ago) parentb440af9
2 files changed+13−10
servant-docs/golden/comprehensive.md+1−10 servant-docs/src/Servant/Docs/Internal.hs+12
servant-docs/golden/comprehensive.md+1−10
@@ -399,16 +399,7 @@
399399- Status code 204
400400- Headers: []
401401
402−- Supported content types are:
403−
404− - `application/json;charset=utf-8`
405− - `application/json`
406−
407−- Example (`application/json;charset=utf-8`, `application/json`):
408−
409−```javascript
410−
411−```
402+- No response body
412403
413404## GET /raw
414405
servant-docs/src/Servant/Docs/Internal.hs+12
@@ -862,6 +862,18 @@ instance {-# OVERLAPPABLE #-}
862862 status = fromInteger $ natVal (Proxy :: Proxy status)
863863 p = Proxy :: Proxy a
864864
865+instance (ReflectMethod method) =>
866+ HasDocs (NoContentVerb method) where
867+ docsFor Proxy (endpoint, action) DocOptions{..} =
868+ single endpoint' action'
869+
870+ where endpoint' = endpoint & method .~ method'
871+ action' = action & response.respStatus .~ 204
872+ & response.respTypes .~ []
873+ & response.respBody .~ []
874+ & response.respHeaders .~ []
875+ method' = reflectMethod (Proxy :: Proxy method)
876+
865877-- | TODO: mention the endpoint is streaming, its framing strategy
866878--
867879-- Also there are no samples.