git.iko.soy/typeable/servant
on master help sign in
Update documentation such that it isn't just for GET
commit256ee412548cce1af827703dfc3b23c0a335446a authorIvan Lazar Miljenovic <Ivan.Miljenovic@gmail.com> dateFri 28 Jul 2017, 16:39 (9 years ago) parent89e0a98
1 file changed+9−8
servant-docs/src/Servant/Docs/Internal.hs+9−8
servant-docs/src/Servant/Docs/Internal.hs+9−8
@@ -125,9 +125,10 @@ data DocCapture = DocCapture
125125 , _capDesc :: String -- user supplied
126126 } deriving (Eq, Ord, Show)
127127
128−-- | A type to represent a /GET/ parameter from the Query String. Holds its name,
129−-- the possible values (leave empty if there isn't a finite number of them),
130−-- and a description of how it influences the output or behavior.
128+-- | A type to represent a /GET/ (or other possible 'HTTP.Method')
129+-- parameter from the Query String. Holds its name, the possible
130+-- values (leave empty if there isn't a finite number of them), and
131+-- a description of how it influences the output or behavior.
131132--
132133-- Write a 'ToParam' instance for your GET parameter types
133134data DocQueryParam = DocQueryParam
@@ -185,7 +186,7 @@ defaultDocOptions :: DocOptions
185186defaultDocOptions = DocOptions
186187 { _maxSamples = 5 }
187188
188−-- | Type of GET parameter:
189+-- | Type of GET (or other 'HTTP.Method') parameter:
189190--
190191-- - Normal corresponds to @QueryParam@, i.e your usual GET parameter
191192-- - List corresponds to @QueryParams@, i.e GET parameters with multiple values
@@ -235,7 +236,7 @@ defResponse = Response
235236-- at an endpoint, with its lenses:
236237--
237238-- - List of captures ('captures')
238−-- - List of GET parameters ('params')
239+-- - List of GET (or other 'HTTP.Method') parameters ('params')
239240-- - What the request body should look like, if any is requested ('rqbody')
240241-- - What the response should be if everything goes well ('response')
241242--
@@ -263,7 +264,7 @@ combineAction :: Action -> Action -> Action
263264Action a c h p n m ts body resp `combineAction` Action a' c' h' p' n' m' _ _ _ =
264265 Action (a <> a') (c <> c') (h <> h') (p <> p') (n <> n') (m <> m') ts body resp
265266
266−-- Default 'Action'. Has no 'captures', no GET 'params', expects
267+-- Default 'Action'. Has no 'captures', no query 'params', expects
267268-- no request body ('rqbody') and the typical response is 'defResponse'.
268269--
269270-- Tweakable with lenses.
@@ -487,8 +488,8 @@ sampleByteStrings ctypes@Proxy Proxy =
487488 enc (t, s) = uncurry (t,,) <$> allMimeRender ctypes s
488489 in concatMap enc samples'
489490
490−-- | The class that helps us automatically get documentation
491−-- for GET parameters.
491+-- | The class that helps us automatically get documentation for GET
492+-- (or other 'HTTP.Method') parameters.
492493--
493494-- Example of an instance:
494495--