Skip to content

Commit 90e971e

Browse files
committed
Merge branch 'master' of https://github.com/byteally/webapi
2 parents 3a90c48 + ab05c27 commit 90e971e

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

tests/WebApi/MockSpec.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ withApp = with (return mockApp)
1515
mockApp :: Wai.Application
1616
mockApp = mockServer serverSettings (MockServer mockServerSettings :: MockServer MockSpec)
1717

18-
data MockSpec = MockSpec
18+
data MockSpec
1919

2020
type MockApi = Static "mock"
2121

22-
data QP = QP { qp1 :: Int, qp2 :: Bool }
22+
data QP = QP { _qp1 :: Int, _qp2 :: Bool }
2323
deriving (Show, Eq, Generic)
2424

25-
data MockOut = MockOut { out1 :: Int
26-
, out2 :: Bool
27-
, out3 :: Char
25+
data MockOut = MockOut { _out1 :: Int
26+
, _out2 :: Bool
27+
, _out3 :: Char
2828
} deriving (Show, Eq, Generic)
2929

3030
instance ToJSON MockOut where

tests/WebApi/RequestSpec.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ newtype Age = Age { unAge :: Int }
3535
deriving (Show, Eq, Generic)
3636
-}
3737

38-
data QP = QP { qp1 :: Int , qp2 :: Maybe Bool, qp3 :: Either Text Double }
38+
data QP = QP { _qp1 :: Int , _qp2 :: Maybe Bool, _qp3 :: Either Text Double }
3939
deriving (Show, Eq, Generic)
4040

41-
data FoP = FoP { fop :: ByteString }
41+
data FoP = FoP { _fop :: ByteString }
4242
deriving (Show, Eq, Generic)
4343

44-
data CP = CP { cp :: Bool }
44+
data CP = CP { _cp :: Bool }
4545
deriving (Show, Eq, Generic)
4646

47-
data HP = HP1 { hp1 :: Int }
48-
| HP2 { hp2 :: Bool }
47+
data HP = HP1 { _hp1 :: Int }
48+
| HP2 { _hp2 :: Bool }
4949
deriving (Show, Eq, Generic)
5050

51-
data FiP = FiP { fip :: FileInfo }
51+
data FiP = FiP { _fip :: FileInfo }
5252
deriving (Show, Eq, Generic)
5353

54-
data RB = RB { rb :: Text }
54+
data RB = RB { _rb :: Text }
5555
deriving (Show, Eq, Generic)
5656

5757
instance FromParam QP 'QueryParam where
@@ -175,9 +175,9 @@ instance ApiHandler ReqSpecImpl OPTIONS ApiR where
175175
handler _ _ = respond ["GET", "POST"]
176176

177177
formHeaders :: [(ByteString, ByteString)] -> [(ByteString, ByteString)] -> [Header]
178-
formHeaders headerKvs cookieKvs = map toHeader headerKvs <> [toCookie cookieKvs]
179-
where toHeader (k, v) = (mk k, v)
180-
toCookie kvs = (hCookie, serializeCookie kvs)
178+
formHeaders headerKvs cookieKvs = map toHeader' headerKvs <> [toCookie' cookieKvs]
179+
where toHeader' (k, v) = (mk k, v)
180+
toCookie' kvs = (hCookie, serializeCookie kvs)
181181

182182
serializeCookie = foldl' (\acc (k, v) -> acc <> ";" <> k <> "=" <> v) ""
183183

tests/WebApi/ResponseSpec.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ respSpecApp = serverApp serverSettings RespSpecImpl
2121
data RespSpec
2222
data RespSpecImpl = RespSpecImpl
2323

24-
data Out = Out { out :: Text }
24+
data Out = Out { _out :: Text }
2525
deriving (Show, Eq, Generic)
26-
data HOut = HOut { hOut :: Text }
26+
data HOut = HOut { _hOut :: Text }
2727
deriving (Show, Eq, Generic)
28-
data COut = COut { cOut :: Text }
28+
data COut = COut { _cOut :: Text }
2929
deriving (Show, Eq, Generic)
30-
data Err = Err { err :: Text }
30+
data Err = Err { _err :: Text }
3131
deriving (Show, Eq, Generic)
3232

3333
instance ToJSON Err

0 commit comments

Comments
 (0)