Skip to content

Commit 9a39799

Browse files
authored
Merge pull request #1475 from akhesaCaro/aeson_2
support Aeson 2
2 parents 3ed24fd + 05ef0dd commit 9a39799

File tree

35 files changed

+2382
-16
lines changed

35 files changed

+2382
-16
lines changed

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ packages:
1212
servant-docs/
1313
servant-foreign/
1414
servant-server/
15+
servant-swagger/
1516
doc/tutorial/
1617

1718
-- servant streaming

servant-auth/servant-auth-client/servant-auth-client.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test-suite spec
6464
build-depends:
6565
hspec >= 2.5.5 && < 2.9
6666
, QuickCheck >= 2.11.3 && < 2.15
67-
, aeson >= 1.3.1.1 && < 1.6
67+
, aeson >= 1.3.1.1 && < 3
6868
, bytestring >= 0.10.6.0 && < 0.11
6969
, http-client >= 0.5.13.1 && < 0.8
7070
, http-types >= 0.12.2 && < 0.13
@@ -74,7 +74,7 @@ test-suite spec
7474
, transformers >= 0.4.2.0 && < 0.6
7575
, wai >= 3.2.1.2 && < 3.3
7676
, warp >= 3.2.25 && < 3.4
77-
, jose >= 0.7.0.0 && < 0.9
77+
, jose >= 0.7.0.0 && < 0.10
7878
other-modules:
7979
Servant.Auth.ClientSpec
8080
default-language: Haskell2010

servant-auth/servant-auth-server/servant-auth-server.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ library
3232
ghc-options: -Wall
3333
build-depends:
3434
base >= 4.10 && < 4.16
35-
, aeson >= 1.3.1.1 && < 1.6
36-
, base64-bytestring >= 1.0.0.1 && < 1.3
35+
, aeson >= 1.0.0.1 && < 3
36+
, base64-bytestring >= 1.0.0.1 && < 2
3737
, blaze-builder >= 0.4.1.0 && < 0.5
3838
, bytestring >= 0.10.6.0 && < 0.11
3939
, case-insensitive >= 1.2.0.11 && < 1.3
4040
, cookie >= 0.4.4 && < 0.5
4141
, data-default-class >= 0.1.2.0 && < 0.2
4242
, entropy >= 0.4.1.3 && < 0.5
4343
, http-types >= 0.12.2 && < 0.13
44-
, jose >= 0.7.0.0 && < 0.9
44+
, jose >= 0.7.0.0 && < 0.10
4545
, lens >= 4.16.1 && < 5.1
4646
, memory >= 0.14.16 && < 0.17
4747
, monad-time >= 0.3.1.0 && < 0.4

servant-auth/servant-auth-swagger/servant-auth-swagger.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ library
3333
build-depends:
3434
base >= 4.10 && < 4.16
3535
, text >= 1.2.3.0 && < 1.3
36-
, servant-swagger >= 1.1.5 && < 1.8
37-
, swagger2 >= 2.2.2 && < 2.7
36+
, servant-swagger >= 1.1.5 && < 2
37+
, swagger2 >= 2.2.2 && < 3
3838
, servant >= 0.13 && < 0.19
3939
, servant-auth == 0.4.*
4040
, lens >= 4.16.1 && < 5.1

servant-auth/servant-auth/servant-auth.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ library
3434
ghc-options: -Wall
3535
build-depends:
3636
base >= 4.10 && < 4.16
37-
, aeson >= 1.3.1.1 && < 1.6
38-
, jose >= 0.7.0.0 && < 0.9
37+
, containers >= 0.6 && < 0.7
38+
, aeson >= 1.3.1.1 && < 3
39+
, jose >= 0.7.0.0 && < 0.10
3940
, lens >= 4.16.1 && < 5.1
4041
, servant >= 0.15 && < 0.19
4142
, text >= 1.2.3.0 && < 1.3

servant-auth/servant-auth/src/Servant/Auth/JWT.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
{-# LANGUAGE CPP #-}
2+
13
module Servant.Auth.JWT where
24

35
import Control.Lens ((^.))
46
import qualified Crypto.JWT as Jose
57
import Data.Aeson (FromJSON, Result (..), ToJSON, fromJSON,
68
toJSON)
7-
import qualified Data.HashMap.Strict as HM
9+
#if MIN_VERSION_aeson(2,0,0)
10+
import qualified Data.Map as KM
11+
#else
12+
import qualified Data.HashMap.Strict as KM
13+
#endif
14+
815
import qualified Data.Text as T
916

1017

@@ -17,7 +24,7 @@ import qualified Data.Text as T
1724
class FromJWT a where
1825
decodeJWT :: Jose.ClaimsSet -> Either T.Text a
1926
default decodeJWT :: FromJSON a => Jose.ClaimsSet -> Either T.Text a
20-
decodeJWT m = case HM.lookup "dat" (m ^. Jose.unregisteredClaims) of
27+
decodeJWT m = case KM.lookup "dat" (m ^. Jose.unregisteredClaims) of
2128
Nothing -> Left "Missing 'dat' claim"
2229
Just v -> case fromJSON v of
2330
Error e -> Left $ T.pack e

servant-client-core/servant-client-core.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ library
7070
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
7171
-- Here can be exceptions if we really need features from the newer versions.
7272
build-depends:
73-
aeson >= 1.4.1.0 && < 1.6
73+
aeson >= 1.4.1.0 && < 3
7474
, base-compat >= 0.10.5 && < 0.12
7575
, base64-bytestring >= 1.0.0.1 && < 1.3
7676
, exceptions >= 0.10.0 && < 0.11

servant-docs/servant-docs.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ library
5252
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
5353
-- Here can be exceptions if we really need features from the newer versions.
5454
build-depends:
55-
aeson >= 1.4.1.0 && < 1.6
55+
aeson >= 1.4.1.0 && < 3
5656
, aeson-pretty >= 0.8.5 && < 0.9
5757
, base-compat >= 0.10.5 && < 0.12
5858
, case-insensitive >= 1.2.0.11 && < 1.3

servant-server/servant-server.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ executable greet
114114
, text
115115

116116
build-depends:
117-
aeson >= 1.4.1.0 && < 1.6
117+
aeson >= 1.4.1.0 && < 3
118118
, warp >= 3.2.25 && < 3.4
119119

120120
test-suite spec
@@ -157,7 +157,7 @@ test-suite spec
157157

158158
-- Additional dependencies
159159
build-depends:
160-
aeson >= 1.4.1.0 && < 1.6
160+
aeson >= 1.4.1.0 && < 3
161161
, directory >= 1.3.0.0 && < 1.4
162162
, hspec >= 2.6.0 && < 2.9
163163
, hspec-wai >= 0.10.1 && < 0.12

servant-swagger/CHANGELOG.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
1.1.9
2+
-------
3+
4+
* Support `servant-0.18`
5+
6+
1.1.8
7+
-------
8+
9+
* Support `servant-0.17`
10+
11+
1.1.7.1
12+
-------
13+
14+
* Support `swagger2-2.4`
15+
16+
1.1.7
17+
-----
18+
19+
* Support servant-0.15
20+
- support for 'Stream' and 'StreamBody' combinators
21+
- orphan 'ToSchema (SourceT m a)' instance
22+
* Fix BodyTypes to work with generalized ReqBody'
23+
[#88](https://github.com/haskell-servant/servant-swagger/pull/88)
24+
25+
1.1.6
26+
-----
27+
28+
* Fixes:
29+
* `validateEveryToJSON` now prints validation errors
30+
31+
* Notes:
32+
* GHC-8.6 compatible release
33+
34+
1.1.5
35+
-----
36+
37+
* Notes:
38+
* `servant-0.13` compatible release
39+
* Drops compatibility with previous `servant` versions.
40+
41+
1.1.4
42+
-----
43+
44+
* Notes:
45+
* `servant-0.12` compatible release
46+
47+
1.1.3.1
48+
---
49+
50+
* Notes:
51+
* GHC-8.2 compatible release
52+
53+
1.1.3
54+
---
55+
56+
* Notes:
57+
* `servant-0.11` compatible release
58+
59+
1.1.2.1
60+
---
61+
62+
* Notes:
63+
* `servant-0.10` compatible release
64+
65+
1.1.2
66+
---
67+
68+
* Minor fixes:
69+
* Support for aeson-1, insert-ordered-containers-0.2
70+
* CaptureAll instance
71+
72+
1.1.1
73+
---
74+
75+
* Minor fixes:
76+
* Fix `unused-imports` and `unused-foralls` warnings;
77+
* Fix tests to match `swagger2-2.1.1` (add `example` property for `UTCTime` schema).
78+
79+
1.1
80+
---
81+
82+
* Breaking changes:
83+
* Requires `swagger2 >= 2.1`
84+
* Requires `servant >= 0.5`
85+
86+
* Notes:
87+
* GHC-8.0 compatible release
88+
89+
1.0.3
90+
---
91+
92+
* Fixes:
93+
* Improve compile-time performance of `BodyTypes` even further (see [18e0d95](https://github.com/haskell-servant/servant-swagger/commit/18e0d95ef6fe9076dd9621cb515d8d1a189f71d3))!
94+
95+
1.0.2
96+
---
97+
98+
* Minor changes:
99+
* Add GHC 7.8 support (see [#26](https://github.com/haskell-servant/servant-swagger/pull/26)).
100+
101+
* Fixes:
102+
* Improve compile-time performance of `BodyTypes` (see [#25](https://github.com/haskell-servant/servant-swagger/issues/25)).
103+
104+
1.0.1
105+
---
106+
107+
* Fixes:
108+
* Stop using `Data.Swagger.Internal`;
109+
* Documentation fixes (links to examples).
110+
111+
1.0
112+
---
113+
114+
* Major changes (see [#24](https://github.com/haskell-servant/servant-swagger/pull/24)):
115+
* Switch to `swagger2-2.*`;
116+
* Add automatic `ToJSON`/`ToSchema` validation tests;
117+
* Add great documentation;
118+
* Export some type-level functions for servant API.
119+
120+
* Minor changes:
121+
* Rework Todo API example;
122+
* Stop exporting `ToResponseHeader`, `AllAccept` and `AllToResponseHeader` (see [bd50db4](https://github.com/haskell-servant/servant-swagger/commit/bd50db48ca6a106e4366560ded70932d409de1e2));
123+
* Change maintainer, update authors/copyrights (see [1a62681](https://github.com/haskell-servant/servant-swagger/commit/1a6268101dc826a92c42e832e402e251c0d32147));
124+
* Include changelog and example files into `extra-source-files`.
125+
126+
0.1.2
127+
---
128+
129+
* Fixes:
130+
* Fix default spec for `ReqBody` param to be required (see [#22](https://github.com/haskell-servant/servant-swagger/issues/22));
131+
* Set version bounds for `swagger2`.
132+
133+
0.1.1
134+
---
135+
136+
* Fixes:
137+
* Fix `subOperations` to filter endpoints also by method (see [#18](https://github.com/haskell-servant/servant-swagger/issues/18));
138+
* Fix response schema in `ToSwagger` instance for `Header` (see [b59e557](https://github.com/haskell-servant/servant-swagger/commit/b59e557a05bc2669332c52b397879e7598747b82)).
139+
140+
0.1
141+
---
142+
* Major changes
143+
* Use `swagger2` for data model (see [#9](https://github.com/dmjio/servant-swagger/pull/9)); this changes almost everything.

0 commit comments

Comments
 (0)