Skip to content

Commit 66e143a

Browse files
committed
Support aeson-1 and i-o-containers-0.2
1 parent 4c28ab5 commit 66e143a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

servant-swagger.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ library
4444
Servant.Swagger.Internal.TypeLevel.Every
4545
Servant.Swagger.Internal.TypeLevel.TMap
4646
hs-source-dirs: src
47-
build-depends: aeson >=0.11.2.0 && <0.12
47+
build-depends: aeson >=0.11.2.0 && <1.1
4848
, base >=4.7.0.0 && <4.10
4949
, bytestring >=0.10.4.0 && <0.11
5050
, http-media >=0.6.3 && <0.7
51-
, insert-ordered-containers >=0.1.0.0 && <0.2
51+
, insert-ordered-containers >=0.1.0.0 && <0.3
5252
, lens >=4.7.0.1 && <4.15
5353
, servant >=0.5 && <0.9
5454
, swagger2 >=2.1 && <2.2

src/Servant/Swagger/Internal.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ instance (KnownSymbol sym, ToParamSchema a, HasSwagger sub) => HasSwagger (Captu
225225
& in_ .~ ParamPath
226226
& paramSchema .~ toParamSchema (Proxy :: Proxy a))
227227

228+
#if MIN_VERSION_servant(0,8,1)
229+
-- | Swagger Spec doesn't have a notion of CaptureAll, this instance is the best effort.
230+
instance (KnownSymbol sym, ToParamSchema a, HasSwagger sub) => HasSwagger (CaptureAll sym a :> sub) where
231+
toSwagger _ = toSwagger (Proxy :: Proxy (Capture sym a :> sub))
232+
#endif
233+
228234
instance (KnownSymbol sym, ToParamSchema a, HasSwagger sub) => HasSwagger (QueryParam sym a :> sub) where
229235
toSwagger _ = toSwagger (Proxy :: Proxy sub)
230236
& addParam param

stack.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
resolver: nightly-2016-07-19
1+
resolver: nightly-2016-09-10
22
packages:
33
- '.'
44
- example/
55
extra-deps:
6-
- swagger2-2.1.1
6+
- servant-0.8.1
7+
- servant-server-0.8.1

0 commit comments

Comments
 (0)