@@ -56,11 +56,11 @@
5656-- >
5757-- > where g = Greet "Hello, haskeller!"
5858-- >
59−-- > instance ToParam (GetParam "capital" Bool) where
59+-- > instance ToParam (QueryParam "capital" Bool) where
6060-- > toParam _ =
61−-- > DocGetParam "capital"
62−-- > ["true", "false"]
63−-- > "Get the greeting message in uppercase (true) or not (false). Default is false."
61+-- > DocQueryParam "capital"
62+-- > ["true", "false"]
63+-- > "Get the greeting message in uppercase (true) or not (false). Default is false."
6464-- >
6565-- > instance ToCapture (Capture "name" Text) where
6666-- > toCapture _ = DocCapture "name" "name of the person to greet"
@@ -70,7 +70,7 @@
7070-- >
7171-- > -- API specification
7272-- > type TestApi =
73−-- > "hello" :> Capture "name" Text :> GetParam "capital" Bool :> Get Greet
73+-- > "hello" :> Capture "name" Text :> QueryParam "capital" Bool :> Get Greet
7474-- > :<|> "greet" :> RQBody Greet :> Post Greet
7575-- > :<|> "delete" :> Capture "greetid" Text :> Delete
7676-- >
@@ -95,7 +95,7 @@ module Servant.Docs
9595 , Endpoint, path, method, defEndpoint
9696 , API, emptyAPI
9797 , DocCapture(..), capSymbol, capDesc
98− , DocGetParam(..), paramName, paramValues, paramDesc
98+ , DocQueryParam(..), paramName, paramValues, paramDesc
9999 , Response, respStatus, respBody, defResponse
100100 , Action, captures, params, rqbody, response, defAction
101101 , single
@@ -190,12 +190,12 @@ data DocCapture = DocCapture
190190 , _capDesc :: String -- user supplied
191191 } deriving (Eq, Show)
192192
193−-- | A type to represent /GET/ parameters. Holds its name,
193+-- | A type to represent a /GET/ parameter from the Query String. Holds its name,
194194-- the possible values (leave empty if there isn't a finite number of them),
195195-- and a description of how it influences the output or behavior.
196196--
197197-- Write a 'ToParam' instance for your GET parameter types
198−data DocGetParam = DocGetParam
198+data DocQueryParam = DocQueryParam
199199 { _paramName :: String -- type supplied
200200 , _paramValues :: [String] -- user supplied
201201 , _paramDesc :: String -- user supplied
@@ -243,7 +243,7 @@ defResponse = Response 200 Nothing
243243-- to transform an action and add some information to it.
244244data Action = Action
245245 { _captures :: [DocCapture] -- type collected + user supplied info
246− , _params :: [DocGetParam] -- type collected + user supplied info
246+ , _params :: [DocQueryParam] -- type collected + user supplied info
247247 , _rqbody :: Maybe ByteString -- user supplied
248248 , _response :: Response -- user supplied
249249 } deriving (Eq, Show)
@@ -273,7 +273,7 @@ single = HM.singleton
273273-- gimme some lenses
274274makeLenses ''Endpoint
275275makeLenses ''DocCapture
276−makeLenses ''DocGetParam
276+makeLenses ''DocQueryParam
277277makeLenses ''Response
278278makeLenses ''Action
279279
@@ -319,13 +319,13 @@ class ToJSON a => ToSample a where
319319--
320320-- Example of an instance:
321321--
322−-- > instance ToParam (GetParam "capital" Bool) where
322+-- > instance ToParam (QueryParam "capital" Bool) where
323323-- > toParam _ =
324−-- > DocGetParam "capital"
325−-- > ["true", "false"]
326−-- > "Get the greeting message in uppercase (true) or not (false). Default is false."
324+-- > DocQueryParam "capital"
325+-- > ["true", "false"]
326+-- > "Get the greeting message in uppercase (true) or not (false). Default is false."
327327class ToParam t where
328− toParam :: Proxy t -> DocGetParam
328+ toParam :: Proxy t -> DocQueryParam
329329
330330-- | The class that helps us automatically get documentation
331331-- for URL captures.
@@ -364,7 +364,7 @@ printMarkdown = imapM_ printEndpoint
364364 captureStr cap =
365365 putStrLn $ "- *" ++ (cap ^. capSymbol) ++ "*: " ++ (cap ^. capDesc)
366366
367− paramsStr :: [DocGetParam] -> IO ()
367+ paramsStr :: [DocQueryParam] -> IO ()
368368 paramsStr [] = return ()
369369 paramsStr l = do
370370 putStrLn "**GET Parameters**: "