on master help sign in
Remove Matrix params.
ec55f4bJulian K. Arni
servant-docs/example/greet.hs+1−8
@@ -46,13 +46,6 @@ instance ToParam (QueryParam "capital" Bool) where
46 \Default is false."
46 \Default is false."
47 Normal
47 Normal
48
48
49−instance ToParam (MatrixParam "lang" String) where
50− toParam _ =
51− DocQueryParam "lang"
52− ["en", "sv", "fr"]
53− "Get the greeting message selected language. Default is en."
54− Normal
55−
56instance ToSample Greet where
49instance ToSample Greet where
57 toSamples _ =
50 toSamples _ =
58 [ ("If you use ?capital=true", Greet "HELLO, HASKELLER")
51 [ ("If you use ?capital=true", Greet "HELLO, HASKELLER")
@@ -81,7 +74,7 @@ intro2 = DocIntro "This title is below the last"
81-- API specification
74-- API specification
82type TestApi =
75type TestApi =
83 -- GET /hello/:name?capital={true, false} returns a Greet as JSON or PlainText
76 -- GET /hello/:name?capital={true, false} returns a Greet as JSON or PlainText
84− "hello" :> MatrixParam "lang" String :> Capture "name" Text :> QueryParam "capital" Bool :> Get '[JSON, PlainText] Greet
77+ "hello" :> Capture "name" Text :> QueryParam "capital" Bool :> Get '[JSON, PlainText] Greet
85
78
86 -- POST /greet with a Greet as JSON in the request body,
79 -- POST /greet with a Greet as JSON in the request body,
87 -- returns a Greet as JSON
80 -- returns a Greet as JSON
servant-docs/example/greet.md+34−33
@@ -1,10 +1,10 @@
1−#### On proper introductions.
1+## On proper introductions.
2
2
3Hello there.
3Hello there.
4
4
5As documentation is usually written for humans, it's often useful to introduce concepts with a few words.
5As documentation is usually written for humans, it's often useful to introduce concepts with a few words.
6
6
7−#### This title is below the last
7+## This title is below the last
8
8
9You'll also note that multiple intros are possible.
9You'll also note that multiple intros are possible.
10
10
@@ -19,12 +19,13 @@ You'll also note that multiple intros are possible.
19- Example: `application/json`
19- Example: `application/json`
20
20
21```javascript
21```javascript
22−"Hello, haskeller!"
22+"HELLO, HASKELLER"
23```
23```
24
24
25#### Response:
25#### Response:
26
26
27- Status code 201
27- Status code 201
28+- Headers: [("X-Example","1729")]
28
29
29- Supported content types are:
30- Supported content types are:
30
31
@@ -42,21 +43,43 @@ You'll also note that multiple intros are possible.
42"Hello, haskeller"
43"Hello, haskeller"
43```
44```
44
45
45−## GET /hello;lang=<value>/:name
46+## DELETE /greet/:greetid
47+
48+#### Title
49+
50+This is some text
51+
52+#### Second secton
53+
54+And some more
46
55
47#### Captures:
56#### Captures:
48
57
49−- *name*: name of the person to greet
58+- *greetid*: identifier of the greet msg to remove
50
59
51−#### Matrix Parameters:
52
60
53−**hello**:
61+- This endpoint is sensitive to the value of the **unicorns** HTTP header.
54
62
55−- lang
63+#### Response:
56− - **Values**: *en, sv, fr*
64+
57− - **Description**: Get the greeting message selected language. Default is en.
65+- Status code 200
66+- Headers: []
67+
68+- Supported content types are:
69+
70+ - `application/json`
71+
72+- Response body as below.
73+
74+```javascript
75+[]
76+```
58
77
78+## GET /hello/:name
59
79
80+#### Captures:
81+
82+- *name*: name of the person to greet
60
83
61#### GET Parameters:
84#### GET Parameters:
62
85
@@ -68,6 +91,7 @@ You'll also note that multiple intros are possible.
68#### Response:
91#### Response:
69
92
70- Status code 200
93- Status code 200
94+- Headers: []
71
95
72- Supported content types are:
96- Supported content types are:
73
97
@@ -98,27 +122,4 @@ You'll also note that multiple intros are possible.
98"Hello, haskeller"
122"Hello, haskeller"
99```
123```
100
124
101−## DELETE /greet/:greetid
102−
103−#### Title
104−
105−This is some text
106−
107−#### Second secton
108−
109−And some more
110−
111−#### Captures:
112−
113−- *greetid*: identifier of the greet msg to remove
114−
115−
116−- This endpoint is sensitive to the value of the **unicorns** HTTP header.
117−
118−#### Response:
119−
120−- Status code 200
121−
122−- No response body
123−
124
125
servant-docs/src/Servant/Docs.hs+1−120
@@ -20,126 +20,7 @@
20-- The only thing you'll need to do will be to implement some classes
20-- The only thing you'll need to do will be to implement some classes
21-- for your captures, get parameters and request or response bodies.
21-- for your captures, get parameters and request or response bodies.
22--
22--
23−-- Here is a complete example that you can run to see the markdown pretty
23+-- See example/greet.hs for an example.
24−-- printer in action:
25−--
26−-- > {-# LANGUAGE DataKinds #-}
27−-- > {-# LANGUAGE DeriveGeneric #-}
28−-- > {-# LANGUAGE FlexibleInstances #-}
29−-- > {-# LANGUAGE MultiParamTypeClasses #-}
30−-- > {-# LANGUAGE OverloadedStrings #-}
31−-- > {-# LANGUAGE TypeOperators #-}
32−-- > {-# OPTIONS_GHC -fno-warn-orphans #-}
33−-- > import Control.Lens
34−-- > import Data.Aeson
35−-- > import Data.Proxy
36−-- > import Data.String.Conversions
37−-- > import Data.Text (Text)
38−-- > import GHC.Generics
39−-- > import Servant.API
40−-- > import Servant.Docs
41−-- >
42−-- > -- * Example
43−-- >
44−-- > -- | A greet message data type
45−-- > newtype Greet = Greet Text
46−-- > deriving (Generic, Show)
47−-- >
48−-- > -- | We can get JSON support automatically. This will be used to parse
49−-- > -- and encode a Greeting as 'JSON'.
50−-- > instance FromJSON Greet
51−-- > instance ToJSON Greet
52−-- >
53−-- > -- | We can also implement 'MimeRender' for additional formats like 'PlainText'.
54−-- > instance MimeRender PlainText Greet where
55−-- > mimeRender Proxy (Greet s) = "\"" <> cs s <> "\""
56−-- >
57−-- > -- We add some useful annotations to our captures,
58−-- > -- query parameters and request body to make the docs
59−-- > -- really helpful.
60−-- > instance ToCapture (Capture "name" Text) where
61−-- > toCapture _ = DocCapture "name" "name of the person to greet"
62−-- >
63−-- > instance ToCapture (Capture "greetid" Text) where
64−-- > toCapture _ = DocCapture "greetid" "identifier of the greet msg to remove"
65−-- >
66−-- > instance ToParam (QueryParam "capital" Bool) where
67−-- > toParam _ =
68−-- > DocQueryParam "capital"
69−-- > ["true", "false"]
70−-- > "Get the greeting message in uppercase (true) or not (false).\
71−-- > \Default is false."
72−-- > Normal
73−-- >
74−-- > instance ToParam (MatrixParam "lang" String) where
75−-- > toParam _ =
76−-- > DocQueryParam "lang"
77−-- > ["en", "sv", "fr"]
78−-- > "Get the greeting message selected language. Default is en."
79−-- > Normal
80−-- >
81−-- > instance ToSample Greet where
82−-- > toSample _ = Just $ Greet "Hello, haskeller!"
83−-- >
84−-- > toSamples _ =
85−-- > [ ("If you use ?capital=true", Greet "HELLO, HASKELLER")
86−-- > , ("If you use ?capital=false", Greet "Hello, haskeller")
87−-- > ]
88−-- >
89−-- > -- We define some introductory sections, these will appear at the top of the
90−-- > -- documentation.
91−-- > --
92−-- > -- We pass them in with 'docsWith', below. If you only want to add
93−-- > -- introductions, you may use 'docsWithIntros'
94−-- > intro1 :: DocIntro
95−-- > intro1 = DocIntro "On proper introductions." -- The title
96−-- > [ "Hello there."
97−-- > , "As documentation is usually written for humans, it's often useful \
98−-- > \to introduce concepts with a few words." ] -- Elements are paragraphs
99−-- >
100−-- > intro2 :: DocIntro
101−-- > intro2 = DocIntro "This title is below the last"
102−-- > [ "You'll also note that multiple intros are possible." ]
103−-- >
104−-- >
105−-- > -- API specification
106−-- > type TestApi =
107−-- > -- GET /hello/:name?capital={true, false} returns a Greet as JSON or PlainText
108−-- > "hello" :> MatrixParam "lang" String :> Capture "name" Text :> QueryParam "capital" Bool :> Get '[JSON, PlainText] Greet
109−-- >
110−-- > -- POST /greet with a Greet as JSON in the request body,
111−-- > -- returns a Greet as JSON
112−-- > :<|> "greet" :> ReqBody '[JSON] Greet :> Post '[JSON] Greet
113−-- >
114−-- > -- DELETE /greet/:greetid
115−-- > :<|> "greet" :> Capture "greetid" Text :> Delete '[JSON] ()
116−-- >
117−-- > testApi :: Proxy TestApi
118−-- > testApi = Proxy
119−-- >
120−-- > -- Build some extra information for the DELETE /greet/:greetid endpoint. We
121−-- > -- want to add documentation about a secret unicorn header and some extra
122−-- > -- notes.
123−-- > extra :: ExtraInfo TestApi
124−-- > extra =
125−-- > extraInfo (Proxy :: Proxy ("greet" :> Capture "greetid" Text :> Delete '[JSON] ())) $
126−-- > defAction & headers <>~ ["unicorns"]
127−-- > & notes <>~ [ DocNote "Title" ["This is some text"]
128−-- > , DocNote "Second secton" ["And some more"]
129−-- > ]
130−-- >
131−-- > -- Generate the data that lets us have API docs. This
132−-- > -- is derived from the type as well as from
133−-- > -- the 'ToCapture', 'ToParam' and 'ToSample' instances from above.
134−-- > --
135−-- > -- If you didn't want intros and extra information, you could just call:
136−-- > --
137−-- > -- > docs testAPI :: API
138−-- > docsGreet :: API
139−-- > docsGreet = docsWith [intro1, intro2] extra testApi
140−-- >
141−-- > main :: IO ()
142−-- > main = putStrLn $ markdown docsGreet
143module Servant.Docs
24module Servant.Docs
144 ( -- * 'HasDocs' class and key functions
25 ( -- * 'HasDocs' class and key functions
145 HasDocs(..), docs, markdown
26 HasDocs(..), docs, markdown
servant-docs/src/Servant/Docs/Internal.hs+1−59
@@ -24,8 +24,7 @@ module Servant.Docs.Internal where
24import Control.Applicative
24import Control.Applicative
25import Control.Arrow (second)
25import Control.Arrow (second)
26import Control.Lens (makeLenses, over, traversed, (%~),
26import Control.Lens (makeLenses, over, traversed, (%~),
27− (&), (.~), (<>~), (^.), _1, _2,
27+ (&), (.~), (<>~), (^.), (|>))
28− _last, (|>))
29import qualified Control.Monad.Omega as Omega
28import qualified Control.Monad.Omega as Omega
30import Data.ByteString.Conversion (ToByteString, toByteString)
29import Data.ByteString.Conversion (ToByteString, toByteString)
31import Data.ByteString.Lazy.Char8 (ByteString)
30import Data.ByteString.Lazy.Char8 (ByteString)
@@ -546,7 +545,6 @@ markdown api = unlines $
546 "" :
545 "" :
547 notesStr (action ^. notes) ++
546 notesStr (action ^. notes) ++
548 capturesStr (action ^. captures) ++
547 capturesStr (action ^. captures) ++
549− mxParamsStr (action ^. mxParams) ++
550 headersStr (action ^. headers) ++
548 headersStr (action ^. headers) ++
551 paramsStr (action ^. params) ++
549 paramsStr (action ^. params) ++
552 rqbodyStr (action ^. rqtypes) (action ^. rqbody) ++
550 rqbodyStr (action ^. rqtypes) (action ^. rqbody) ++
@@ -590,20 +588,6 @@ markdown api = unlines $
590 captureStr cap =
588 captureStr cap =
591 "- *" ++ (cap ^. capSymbol) ++ "*: " ++ (cap ^. capDesc)
589 "- *" ++ (cap ^. capSymbol) ++ "*: " ++ (cap ^. capDesc)
592
590
593− mxParamsStr :: [(String, [DocQueryParam])] -> [String]
594− mxParamsStr [] = []
595− mxParamsStr l =
596− "#### Matrix Parameters:" :
597− "" :
598− map segmentStr l
599− segmentStr :: (String, [DocQueryParam]) -> String
600− segmentStr (segment, l) = unlines $
601− ("**" ++ segment ++ "**:") :
602− "" :
603− map paramStr l ++
604− "" :
605− []
606−
607 headersStr :: [Text] -> [String]
591 headersStr :: [Text] -> [String]
608 headersStr [] = []
592 headersStr [] = []
609 headersStr l = [""] ++ map headerStr l ++ [""]
593 headersStr l = [""] ++ map headerStr l ++ [""]
@@ -898,48 +882,6 @@ instance (KnownSymbol sym, ToParam (QueryFlag sym), HasDocs sublayout)
898 action' = over params (|> toParam paramP) action
882 action' = over params (|> toParam paramP) action
899
883
900
884
901−instance (KnownSymbol sym, ToParam (MatrixParam sym a), HasDocs sublayout)
902− => HasDocs (MatrixParam sym a :> sublayout) where
903−
904− docsFor Proxy (endpoint, action) =
905− docsFor sublayoutP (endpoint', action')
906−
907− where sublayoutP = Proxy :: Proxy sublayout
908− paramP = Proxy :: Proxy (MatrixParam sym a)
909− segment = endpoint ^. (path._last)
910− segment' = action ^. (mxParams._last._1)
911− endpoint' = over (path._last) (\p -> p ++ ";" ++ symbolVal symP ++ "=<value>") endpoint
912−
913− action' = if segment' /= segment
914− -- This is the first matrix parameter for this segment, insert a new entry into the mxParams list
915− then over mxParams (|> (segment, [toParam paramP])) action
916− -- We've already inserted a matrix parameter for this segment, append to the existing list
917− else action & mxParams._last._2 <>~ [toParam paramP]
918− symP = Proxy :: Proxy sym
919−
920−
921−instance (KnownSymbol sym, {- ToParam (MatrixParams sym a), -} HasDocs sublayout)
922− => HasDocs (MatrixParams sym a :> sublayout) where
923−
924− docsFor Proxy (endpoint, action) =
925− docsFor sublayoutP (endpoint', action)
926−
927− where sublayoutP = Proxy :: Proxy sublayout
928− endpoint' = over path (\p -> p ++ [";" ++ symbolVal symP ++ "=<value>"]) endpoint
929− symP = Proxy :: Proxy sym
930−
931−
932−instance (KnownSymbol sym, {- ToParam (MatrixFlag sym), -} HasDocs sublayout)
933− => HasDocs (MatrixFlag sym :> sublayout) where
934−
935− docsFor Proxy (endpoint, action) =
936− docsFor sublayoutP (endpoint', action)
937−
938− where sublayoutP = Proxy :: Proxy sublayout
939−
940− endpoint' = over path (\p -> p ++ [";" ++ symbolVal symP]) endpoint
941− symP = Proxy :: Proxy sym
942−
943instance HasDocs Raw where
885instance HasDocs Raw where
944 docsFor _proxy (endpoint, action) _ =
886 docsFor _proxy (endpoint, action) _ =
945 single endpoint action
887 single endpoint action
servant-foreign/src/Servant/Foreign.hs+15−50
@@ -20,7 +20,6 @@ module Servant.Foreign
20 ( HasForeign(..)
20 ( HasForeign(..)
21 , Segment(..)
21 , Segment(..)
22 , SegmentType(..)
22 , SegmentType(..)
23− , MatrixArg
24 , FunctionName
23 , FunctionName
25 , QueryArg(..)
24 , QueryArg(..)
26 , HeaderArg(..)
25 , HeaderArg(..)
@@ -47,15 +46,14 @@ module Servant.Foreign
47 , module Servant.API
46 , module Servant.API
48 ) where
47 ) where
49
48
50−import Control.Lens (makeLenses, (%~), (&), (.~),
49+import Control.Lens (makeLenses, (%~), (&), (.~), (<>~))
51− (<>~), _last)
52−import Data.Monoid ((<>))
50+import Data.Monoid ((<>))
53−import Data.Text
54−import Data.Proxy
51+import Data.Proxy
52+import Data.Text
55−import GHC.Exts (Constraint)
53+import GHC.Exts (Constraint)
56−import GHC.TypeLits
54+import GHC.TypeLits
57−import Servant.API
58−import Prelude hiding (concat)
55+import Prelude hiding (concat)
56+import Servant.API
59
57
60-- | Function name builder that simply concat each part together
58-- | Function name builder that simply concat each part together
61concatCase :: FunctionName -> Text
59concatCase :: FunctionName -> Text
@@ -76,7 +74,7 @@ camelCase (p:ps) = concat $ p : camelCase' ps
76
74
77type Arg = Text
75type Arg = Text
78
76
79−data Segment = Segment { _segment :: SegmentType, _matrix :: [MatrixArg] }
77+newtype Segment = Segment { _segment :: SegmentType }
80 deriving (Eq, Show)
78 deriving (Eq, Show)
81
79
82data SegmentType = Static Text -- ^ a static path segment. like "/foo"
80data SegmentType = Static Text -- ^ a static path segment. like "/foo"
@@ -105,8 +103,6 @@ data HeaderArg = HeaderArg
105 } deriving (Eq, Show)
103 } deriving (Eq, Show)
106
104
107
105
108−type MatrixArg = QueryArg
109−
110data Url = Url
106data Url = Url
111 { _path :: Path
107 { _path :: Path
112 , _queryStr :: [QueryArg]
108 , _queryStr :: [QueryArg]
@@ -132,12 +128,12 @@ makeLenses ''Url
132makeLenses ''Req
128makeLenses ''Req
133
129
134isCapture :: Segment -> Bool
130isCapture :: Segment -> Bool
135−isCapture (Segment (Cap _) _) = True
131+isCapture (Segment (Cap _)) = True
136−isCapture _ = False
132+isCapture _ = False
137
133
138captureArg :: Segment -> Arg
134captureArg :: Segment -> Arg
139−captureArg (Segment (Cap s) _) = s
135+captureArg (Segment (Cap s)) = s
140−captureArg _ = error "captureArg called on non capture"
136+captureArg _ = error "captureArg called on non capture"
141
137
142defReq :: Req
138defReq :: Req
143defReq = Req defUrl "GET" [] False []
139defReq = Req defUrl "GET" [] False []
@@ -169,7 +165,7 @@ instance (KnownSymbol sym, HasForeign sublayout)
169
165
170 foreignFor Proxy req =
166 foreignFor Proxy req =
171 foreignFor (Proxy :: Proxy sublayout) $
167 foreignFor (Proxy :: Proxy sublayout) $
172− req & reqUrl.path <>~ [Segment (Cap str) []]
168+ req & reqUrl.path <>~ [Segment (Cap str)]
173 & funcName %~ (++ ["by", str])
169 & funcName %~ (++ ["by", str])
174
170
175 where str = pack . symbolVal $ (Proxy :: Proxy sym)
171 where str = pack . symbolVal $ (Proxy :: Proxy sym)
@@ -242,37 +238,6 @@ instance (KnownSymbol sym, HasForeign sublayout)
242
238
243 where str = pack . symbolVal $ (Proxy :: Proxy sym)
239 where str = pack . symbolVal $ (Proxy :: Proxy sym)
244
240
245−instance (KnownSymbol sym, HasForeign sublayout)
246− => HasForeign (MatrixParam sym a :> sublayout) where
247− type Foreign (MatrixParam sym a :> sublayout) = Foreign sublayout
248−
249− foreignFor Proxy req =
250− foreignFor (Proxy :: Proxy sublayout) $
251− req & reqUrl.path._last.matrix <>~ [QueryArg strArg Normal]
252−
253− where str = pack . symbolVal $ (Proxy :: Proxy sym)
254− strArg = str <> "Value"
255−
256−instance (KnownSymbol sym, HasForeign sublayout)
257− => HasForeign (MatrixParams sym a :> sublayout) where
258− type Foreign (MatrixParams sym a :> sublayout) = Foreign sublayout
259−
260− foreignFor Proxy req =
261− foreignFor (Proxy :: Proxy sublayout) $
262− req & reqUrl.path._last.matrix <>~ [QueryArg str List]
263−
264− where str = pack . symbolVal $ (Proxy :: Proxy sym)
265−
266−instance (KnownSymbol sym, HasForeign sublayout)
267− => HasForeign (MatrixFlag sym :> sublayout) where
268− type Foreign (MatrixFlag sym :> sublayout) = Foreign sublayout
269−
270− foreignFor Proxy req =
271− foreignFor (Proxy :: Proxy sublayout) $
272− req & reqUrl.path._last.matrix <>~ [QueryArg str Flag]
273−
274− where str = pack . symbolVal $ (Proxy :: Proxy sym)
275−
276instance HasForeign Raw where
241instance HasForeign Raw where
277 type Foreign Raw = Method -> Req
242 type Foreign Raw = Method -> Req
278
243
@@ -293,7 +258,7 @@ instance (KnownSymbol path, HasForeign sublayout)
293
258
294 foreignFor Proxy req =
259 foreignFor Proxy req =
295 foreignFor (Proxy :: Proxy sublayout) $
260 foreignFor (Proxy :: Proxy sublayout) $
296− req & reqUrl.path <>~ [Segment (Static str) []]
261+ req & reqUrl.path <>~ [Segment (Static str)]
297 & funcName %~ (++ [str])
262 & funcName %~ (++ [str])
298
263
299 where str = Data.Text.map (\c -> if c == '.' then '_' else c) . pack . symbolVal $ (Proxy :: Proxy path)
264 where str = Data.Text.map (\c -> if c == '.' then '_' else c) . pack . symbolVal $ (Proxy :: Proxy path)
servant-js/src/Servant/JS/Internal.hs+4−9
@@ -9,7 +9,6 @@ module Servant.JS.Internal
9 , segmentTypeToStr
9 , segmentTypeToStr
10 , jsParams
10 , jsParams
11 , jsGParams
11 , jsGParams
12− , jsMParams
13 , paramToStr
12 , paramToStr
14 , toValidFunctionName
13 , toValidFunctionName
15 , toJSHeader
14 , toJSHeader
@@ -92,7 +91,7 @@ toValidFunctionName :: Text -> Text
92toValidFunctionName t =
91toValidFunctionName t =
93 case T.uncons t of
92 case T.uncons t of
94 Just (x,xs) ->
93 Just (x,xs) ->
95− setFirstChar x `T.cons` T.filter remainder xs
94+ setFirstChar x `T.cons` T.filter remainder xs
96 Nothing -> "_"
95 Nothing -> "_"
97 where
96 where
98 setFirstChar c = if firstChar c then c else '_'
97 setFirstChar c = if firstChar c then c else '_'
@@ -105,7 +104,7 @@ toValidFunctionName t =
105 , Set.titlecaseLetter
104 , Set.titlecaseLetter
106 , Set.modifierLetter
105 , Set.modifierLetter
107 , Set.otherLetter
106 , Set.otherLetter
108− , Set.letterNumber
107+ , Set.letterNumber
109 ]
108 ]
110 remainderOK = firstLetterOK
109 remainderOK = firstLetterOK
111 <> mconcat
110 <> mconcat
@@ -134,8 +133,8 @@ jsSegments [x] = "/" <> segmentToStr x False
134jsSegments (x:xs) = "/" <> segmentToStr x True <> jsSegments xs
133jsSegments (x:xs) = "/" <> segmentToStr x True <> jsSegments xs
135
134
136segmentToStr :: Segment -> Bool -> Text
135segmentToStr :: Segment -> Bool -> Text
137−segmentToStr (Segment st ms) notTheEnd =
136+segmentToStr (Segment st) notTheEnd =
138− segmentTypeToStr st <> jsMParams ms <> if notTheEnd then "" else "'"
137+ segmentTypeToStr st <> if notTheEnd then "" else "'"
139
138
140segmentTypeToStr :: SegmentType -> Text
139segmentTypeToStr :: SegmentType -> Text
141segmentTypeToStr (Static s) = s
140segmentTypeToStr (Static s) = s
@@ -149,10 +148,6 @@ jsGParams s (x:xs) = paramToStr x True <> s <> jsGParams s xs
149jsParams :: [QueryArg] -> Text
148jsParams :: [QueryArg] -> Text
150jsParams = jsGParams "&"
149jsParams = jsGParams "&"
151
150
152−jsMParams :: [MatrixArg] -> Text
153−jsMParams [] = ""
154−jsMParams xs = ";" <> jsGParams ";" xs
155−
156paramToStr :: QueryArg -> Bool -> Text
151paramToStr :: QueryArg -> Bool -> Text
157paramToStr qarg notTheEnd =
152paramToStr qarg notTheEnd =
158 case qarg ^. argType of
153 case qarg ^. argType of
servant-mock/src/Servant/Mock.hs−11
@@ -136,17 +136,6 @@ instance (KnownSymbol s, FromHttpApiData a, HasMock rest)
136instance (KnownSymbol s, HasMock rest) => HasMock (QueryFlag s :> rest) where
136instance (KnownSymbol s, HasMock rest) => HasMock (QueryFlag s :> rest) where
137 mock _ = \_ -> mock (Proxy :: Proxy rest)
137 mock _ = \_ -> mock (Proxy :: Proxy rest)
138
138
139−instance (KnownSymbol s, FromHttpApiData a, HasMock rest)
140− => HasMock (MatrixParam s a :> rest) where
141− mock _ = \_ -> mock (Proxy :: Proxy rest)
142−
143−instance (KnownSymbol s, FromHttpApiData a, HasMock rest)
144− => HasMock (MatrixParams s a :> rest) where
145− mock _ = \_ -> mock (Proxy :: Proxy rest)
146−
147−instance (KnownSymbol s, HasMock rest) => HasMock (MatrixFlag s :> rest) where
148− mock _ = \_ -> mock (Proxy :: Proxy rest)
149−
150instance (KnownSymbol h, FromHttpApiData a, HasMock rest) => HasMock (Header h a :> rest) where
139instance (KnownSymbol h, FromHttpApiData a, HasMock rest) => HasMock (Header h a :> rest) where
151 mock _ = \_ -> mock (Proxy :: Proxy rest)
140 mock _ = \_ -> mock (Proxy :: Proxy rest)
152
141