diff --git a/servant-docs/golden/comprehensive.md b/servant-docs/golden/comprehensive.md index 2277af31..5bb7c4e9 100644 --- a/servant-docs/golden/comprehensive.md +++ b/servant-docs/golden/comprehensive.md @@ -399,16 +399,7 @@ - Status code 204 - Headers: [] -- Supported content types are: - - - `application/json;charset=utf-8` - - `application/json` - -- Example (`application/json;charset=utf-8`, `application/json`): - -```javascript - -``` +- No response body ## GET /raw diff --git a/servant-docs/src/Servant/Docs/Internal.hs b/servant-docs/src/Servant/Docs/Internal.hs index 051a9dbc..d5b51d93 100644 --- a/servant-docs/src/Servant/Docs/Internal.hs +++ b/servant-docs/src/Servant/Docs/Internal.hs @@ -862,6 +862,18 @@ instance {-# OVERLAPPABLE #-} status = fromInteger $ natVal (Proxy :: Proxy status) p = Proxy :: Proxy a +instance (ReflectMethod method) => + HasDocs (NoContentVerb method) where + docsFor Proxy (endpoint, action) DocOptions{..} = + single endpoint' action' + + where endpoint' = endpoint & method .~ method' + action' = action & response.respStatus .~ 204 + & response.respTypes .~ [] + & response.respBody .~ [] + & response.respHeaders .~ [] + method' = reflectMethod (Proxy :: Proxy method) + -- | TODO: mention the endpoint is streaming, its framing strategy -- -- Also there are no samples.