From a10f5531250c50676e1274a2a485688e58987ad7 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Thu, 5 Nov 2020 10:22:36 +0100 Subject: [PATCH 01/10] Swagger instances for UVerb. --- servant-swagger.cabal | 2 +- src/Servant/Swagger/Internal.hs | 61 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/servant-swagger.cabal b/servant-swagger.cabal index 64e7b3490..3529025c0 100644 --- a/servant-swagger.cabal +++ b/servant-swagger.cabal @@ -82,7 +82,7 @@ library , http-media >=0.7.1.3 && <0.9 , insert-ordered-containers >=0.2.1.0 && <0.3 , lens >=4.17 && <4.20 - , servant >=0.17 && <0.19 + , servant >=0.17 && <0.20 , singleton-bool >=0.1.4 && <0.2 , swagger2 >=2.3.0.1 && <2.7 , text >=1.2.3.0 && <1.3 diff --git a/src/Servant/Swagger/Internal.hs b/src/Servant/Swagger/Internal.hs index 7f160319a..f21bce8e4 100644 --- a/src/Servant/Swagger/Internal.hs +++ b/src/Servant/Swagger/Internal.hs @@ -1,12 +1,14 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- TODO: can we get rid of this? {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE StandaloneDeriving #-} -- TODO: can we get away with terminating support for ghcs that don't have this? {-# LANGUAGE TypeOperators #-} #if __GLASGOW_HASKELL__ >= 806 {-# LANGUAGE UndecidableInstances #-} @@ -16,6 +18,10 @@ module Servant.Swagger.Internal where import Prelude () import Prelude.Compat +-- TODO: turn on lower version bound once servant is released. +-- #if MIN_VERSION_servant(0,19,0) +import Control.Applicative ((<|>)) +-- #endif import Control.Lens import Data.Aeson import Data.HashMap.Strict.InsOrd (InsOrdHashMap) @@ -184,6 +190,61 @@ instance SwaggerMethod 'OPTIONS where swaggerMethod _ = options instance SwaggerMethod 'HEAD where swaggerMethod _ = head_ instance SwaggerMethod 'PATCH where swaggerMethod _ = patch +-- TODO: turn on lower version bound once servant is released. +-- #if MIN_VERSION_servant(0,19,0) +instance HasSwagger (UVerb method cs '[]) where + toSwagger _ = mempty + +-- | @since +instance + {-# OVERLAPPABLE #-} + ( ToSchema a, + HasStatus a, + AllAccept cs, + SwaggerMethod method, + HasSwagger (UVerb method cs as) + ) => + HasSwagger (UVerb method cs (a ': as)) + where + toSwagger _ = + toSwagger (Proxy :: Proxy (Verb method (StatusOf a) cs a)) + `combineSwagger` toSwagger (Proxy :: Proxy (UVerb method cs as)) + where + -- workaround for https://github.com/GetShopTV/swagger2/issues/218 + -- We'd like to juse use (<>) but the instances are wrong + combinePathItem :: PathItem -> PathItem -> PathItem + combinePathItem s t = PathItem + { _pathItemGet = _pathItemGet s <> _pathItemGet t + , _pathItemPut = _pathItemPut s <> _pathItemPut t + , _pathItemPost = _pathItemPost s <> _pathItemPost t + , _pathItemDelete = _pathItemDelete s <> _pathItemDelete t + , _pathItemOptions = _pathItemOptions s <> _pathItemOptions t + , _pathItemHead = _pathItemHead s <> _pathItemHead t + , _pathItemPatch = _pathItemPatch s <> _pathItemPatch t + , _pathItemParameters = _pathItemParameters s <> _pathItemParameters t + } + + combineSwagger :: Swagger -> Swagger -> Swagger + combineSwagger s t = Swagger + { _swaggerInfo = _swaggerInfo s <> _swaggerInfo t + , _swaggerHost = _swaggerHost s <|> _swaggerHost t + , _swaggerBasePath = _swaggerBasePath s <|> _swaggerBasePath t + , _swaggerSchemes = _swaggerSchemes s <> _swaggerSchemes t + , _swaggerConsumes = _swaggerConsumes s <> _swaggerConsumes t + , _swaggerProduces = _swaggerProduces s <> _swaggerProduces t + , _swaggerPaths = InsOrdHashMap.unionWith combinePathItem (_swaggerPaths s) (_swaggerPaths t) + , _swaggerDefinitions = _swaggerDefinitions s <> _swaggerDefinitions t + , _swaggerParameters = _swaggerParameters s <> _swaggerParameters t + , _swaggerResponses = _swaggerResponses s <> _swaggerResponses t + , _swaggerSecurityDefinitions = _swaggerSecurityDefinitions s <> _swaggerSecurityDefinitions t + , _swaggerSecurity = _swaggerSecurity s <> _swaggerSecurity t + , _swaggerTags = _swaggerTags s <> _swaggerTags t + , _swaggerExternalDocs = _swaggerExternalDocs s <|> _swaggerExternalDocs t + } + +deriving instance ToSchema a => ToSchema (WithStatus s a) +-- #endif + instance {-# OVERLAPPABLE #-} (ToSchema a, AllAccept cs, KnownNat status, SwaggerMethod method) => HasSwagger (Verb method status cs a) where toSwagger _ = toSwagger (Proxy :: Proxy (Verb method status cs (Headers '[] a))) From da507204751529061291e382bf481149c0109554 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Mon, 3 Aug 2020 16:53:50 +0200 Subject: [PATCH 02/10] ... --- cabal.project | 6 +++++- src/Servant/Swagger/Internal.hs | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 2d61bba2b..eacb9181f 100644 --- a/cabal.project +++ b/cabal.project @@ -1,2 +1,6 @@ -packages: . +packages: + ./ + ../servant/servant/ + ../servant/servant-server/ + allow-newer: aeson-pretty-0.8.7:base-compat diff --git a/src/Servant/Swagger/Internal.hs b/src/Servant/Swagger/Internal.hs index f21bce8e4..66072e95f 100644 --- a/src/Servant/Swagger/Internal.hs +++ b/src/Servant/Swagger/Internal.hs @@ -15,6 +15,8 @@ #endif module Servant.Swagger.Internal where +-- TODO: write tests! + import Prelude () import Prelude.Compat From 95a41f2068f3d30bc0d9e24eeee49c03360ef336 Mon Sep 17 00:00:00 2001 From: Matthias Fischmann Date: Tue, 4 Aug 2020 09:25:16 +0200 Subject: [PATCH 03/10] test. --- src/Servant/Swagger/Internal.hs | 2 - test/Servant/SwaggerSpec.hs | 92 +++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/src/Servant/Swagger/Internal.hs b/src/Servant/Swagger/Internal.hs index 66072e95f..f21bce8e4 100644 --- a/src/Servant/Swagger/Internal.hs +++ b/src/Servant/Swagger/Internal.hs @@ -15,8 +15,6 @@ #endif module Servant.Swagger.Internal where --- TODO: write tests! - import Prelude () import Prelude.Compat diff --git a/test/Servant/SwaggerSpec.hs b/test/Servant/SwaggerSpec.hs index 1d03908fe..0460aa36a 100644 --- a/test/Servant/SwaggerSpec.hs +++ b/test/Servant/SwaggerSpec.hs @@ -4,6 +4,7 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE PackageImports #-} module Servant.SwaggerSpec where @@ -40,6 +41,7 @@ spec = describe "HasSwagger" $ do it "Todo API" $ checkAPI (Proxy :: Proxy TodoAPI) todoAPI it "Hackage API (with tags)" $ checkSwagger hackageSwaggerWithTags hackageAPI it "GetPost API (test subOperations)" $ checkSwagger getPostSwagger getPostAPI + it "UVerb API" $ checkSwagger uverbSwagger uverbAPI it "Comprehensive API" $ do let _x = toSwagger comprehensiveAPI True `shouldBe` True -- type-level test @@ -406,3 +408,93 @@ getPostAPI = [aesonQQ| } |] +-- ======================================================================= +-- UVerb API +-- ======================================================================= + +data FisxUser = FisxUser {name :: String} + deriving (Eq, Show, Generic) + +instance ToSchema FisxUser + +instance HasStatus FisxUser where + type StatusOf FisxUser = 203 + +data ArianUser = ArianUser + deriving (Eq, Show, Generic) + +instance ToSchema ArianUser + +type UVerbAPI = "fisx" :> UVerb 'GET '[JSON] '[FisxUser, WithStatus 303 String] + :<|> "arian" :> UVerb 'POST '[JSON] '[WithStatus 201 ArianUser] + +uverbSwagger :: Swagger +uverbSwagger = toSwagger (Proxy :: Proxy UVerbAPI) + +uverbAPI :: Value +uverbAPI = [aesonQQ| +{ + "swagger": "2.0", + "info": { + "version": "", + "title": "" + }, + "paths": { + "/fisx": { + "get": { + "produces": [ + "application/json;charset=utf-8" + ], + "responses": { + "303": { + "schema": { + "type": "string" + }, + "description": "" + }, + "203": { + "schema": { + "$ref": "#/definitions/FisxUser" + }, + "description": "" + } + } + } + }, + "/arian": { + "post": { + "produces": [ + "application/json;charset=utf-8" + ], + "responses": { + "201": { + "schema": { + "$ref": "#/definitions/ArianUser" + }, + "description": "" + } + } + } + } + }, + "definitions": { + "FisxUser": { + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" + }, + "ArianUser": { + "type": "string", + "enum": [ + "ArianUser" + ] + } + } +} +|] From 0841c2b560133fc3710aca6aa67f6dfddb2f06d1 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Thu, 5 Nov 2020 10:55:49 +0100 Subject: [PATCH 04/10] Update bounds and move orphan --- cabal.project | 6 +----- servant-swagger.cabal | 2 +- src/Servant/Swagger/Internal.hs | 10 ---------- src/Servant/Swagger/Internal/Orphans.hs | 10 ++++++++-- src/Servant/Swagger/Internal/TypeLevel/API.hs | 1 - stack.yaml | 4 ++-- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/cabal.project b/cabal.project index eacb9181f..2d61bba2b 100644 --- a/cabal.project +++ b/cabal.project @@ -1,6 +1,2 @@ -packages: - ./ - ../servant/servant/ - ../servant/servant-server/ - +packages: . allow-newer: aeson-pretty-0.8.7:base-compat diff --git a/servant-swagger.cabal b/servant-swagger.cabal index 3529025c0..962311412 100644 --- a/servant-swagger.cabal +++ b/servant-swagger.cabal @@ -82,7 +82,7 @@ library , http-media >=0.7.1.3 && <0.9 , insert-ordered-containers >=0.2.1.0 && <0.3 , lens >=4.17 && <4.20 - , servant >=0.17 && <0.20 + , servant >=0.18.1 && <0.19 , singleton-bool >=0.1.4 && <0.2 , swagger2 >=2.3.0.1 && <2.7 , text >=1.2.3.0 && <1.3 diff --git a/src/Servant/Swagger/Internal.hs b/src/Servant/Swagger/Internal.hs index f21bce8e4..666636a9b 100644 --- a/src/Servant/Swagger/Internal.hs +++ b/src/Servant/Swagger/Internal.hs @@ -1,14 +1,12 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- TODO: can we get rid of this? {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE StandaloneDeriving #-} -- TODO: can we get away with terminating support for ghcs that don't have this? {-# LANGUAGE TypeOperators #-} #if __GLASGOW_HASKELL__ >= 806 {-# LANGUAGE UndecidableInstances #-} @@ -18,10 +16,7 @@ module Servant.Swagger.Internal where import Prelude () import Prelude.Compat --- TODO: turn on lower version bound once servant is released. --- #if MIN_VERSION_servant(0,19,0) import Control.Applicative ((<|>)) --- #endif import Control.Lens import Data.Aeson import Data.HashMap.Strict.InsOrd (InsOrdHashMap) @@ -190,8 +185,6 @@ instance SwaggerMethod 'OPTIONS where swaggerMethod _ = options instance SwaggerMethod 'HEAD where swaggerMethod _ = head_ instance SwaggerMethod 'PATCH where swaggerMethod _ = patch --- TODO: turn on lower version bound once servant is released. --- #if MIN_VERSION_servant(0,19,0) instance HasSwagger (UVerb method cs '[]) where toSwagger _ = mempty @@ -242,9 +235,6 @@ instance , _swaggerExternalDocs = _swaggerExternalDocs s <|> _swaggerExternalDocs t } -deriving instance ToSchema a => ToSchema (WithStatus s a) --- #endif - instance {-# OVERLAPPABLE #-} (ToSchema a, AllAccept cs, KnownNat status, SwaggerMethod method) => HasSwagger (Verb method status cs a) where toSwagger _ = toSwagger (Proxy :: Proxy (Verb method status cs (Headers '[] a))) diff --git a/src/Servant/Swagger/Internal/Orphans.hs b/src/Servant/Swagger/Internal/Orphans.hs index ea97cb496..b457bbb1c 100644 --- a/src/Servant/Swagger/Internal/Orphans.hs +++ b/src/Servant/Swagger/Internal/Orphans.hs @@ -1,5 +1,7 @@ -{-# LANGUAGE ScopedTypeVariables #-} -{-# OPTIONS_GHC -fno-warn-orphans #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE StandaloneDeriving #-} module Servant.Swagger.Internal.Orphans where import Data.Proxy @@ -7,6 +9,7 @@ import Data.Proxy import Data.Swagger import Servant.Types.SourceT (SourceT) +import Servant.API (WithStatus(..)) -- | Pretend that 'SourceT m a' is '[a]'. -- @@ -14,3 +17,6 @@ import Servant.Types.SourceT -- instance ToSchema a => ToSchema (SourceT m a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy [a]) + +-- @since +deriving instance ToSchema a => ToSchema (WithStatus s a) diff --git a/src/Servant/Swagger/Internal/TypeLevel/API.hs b/src/Servant/Swagger/Internal/TypeLevel/API.hs index 3c79ed8ce..818e378ba 100644 --- a/src/Servant/Swagger/Internal/TypeLevel/API.hs +++ b/src/Servant/Swagger/Internal/TypeLevel/API.hs @@ -7,7 +7,6 @@ {-# LANGUAGE UndecidableInstances #-} module Servant.Swagger.Internal.TypeLevel.API where -import Data.Type.Bool (If) import GHC.Exts (Constraint) import Servant.API diff --git a/stack.yaml b/stack.yaml index 6fc693944..4011b92ac 100644 --- a/stack.yaml +++ b/stack.yaml @@ -4,5 +4,5 @@ packages: - example/ extra-deps: -- servant-0.18 -- servant-server-0.18 +- servant-0.18.1 +- servant-server-0.18.1 From 08c07511a2a61aeb15f8f9e0c34915769c52d509 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Thu, 5 Nov 2020 18:49:27 +0100 Subject: [PATCH 05/10] servant 0.17.* -> 0.18.1 on CI --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e45f72b72..ce5e36159 100644 --- a/.travis.yml +++ b/.travis.yml @@ -149,8 +149,8 @@ script: - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='swagger2 ==2.4.*' all # Constraint set swagger2-2.5 - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='swagger2 ==2.5.*' all - # Constraint set servant-0.17 - - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant == 0.17.*' all + # Constraint set servant-0.18.1 + - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant == 0.18.1' all # REGENDATA ("0.9.20200121",["--config=cabal.haskell-ci","cabal.project"]) # EOF From 91b84bb34b4acca6820b8164cfccf37835b086a9 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Mon, 9 Nov 2020 18:52:05 +0100 Subject: [PATCH 06/10] Remove support for WithStatus for GHC < 8.8.1 --- src/Servant/Swagger/Internal/Orphans.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Servant/Swagger/Internal/Orphans.hs b/src/Servant/Swagger/Internal/Orphans.hs index b457bbb1c..2c50c903f 100644 --- a/src/Servant/Swagger/Internal/Orphans.hs +++ b/src/Servant/Swagger/Internal/Orphans.hs @@ -19,4 +19,6 @@ instance ToSchema a => ToSchema (SourceT m a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy [a]) -- @since +#if __GLASGOW_HASKELL__ >= 881 deriving instance ToSchema a => ToSchema (WithStatus s a) +#endif From 89799f4e9eb42072c9525740322057094b966324 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 10 Nov 2020 10:14:00 +0100 Subject: [PATCH 07/10] Fix: CPP missing --- src/Servant/Swagger/Internal/Orphans.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Servant/Swagger/Internal/Orphans.hs b/src/Servant/Swagger/Internal/Orphans.hs index 2c50c903f..1523dc317 100644 --- a/src/Servant/Swagger/Internal/Orphans.hs +++ b/src/Servant/Swagger/Internal/Orphans.hs @@ -1,6 +1,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} module Servant.Swagger.Internal.Orphans where From 341fdde464d585d07b306a32e503c1f7d28a6567 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Thu, 12 Nov 2020 18:04:23 +0100 Subject: [PATCH 08/10] Make UVerb example independent of WithStatus --- test/Servant/SwaggerSpec.hs | 117 ++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 64 deletions(-) diff --git a/test/Servant/SwaggerSpec.hs b/test/Servant/SwaggerSpec.hs index 0460aa36a..2c1359c60 100644 --- a/test/Servant/SwaggerSpec.hs +++ b/test/Servant/SwaggerSpec.hs @@ -412,89 +412,78 @@ getPostAPI = [aesonQQ| -- UVerb API -- ======================================================================= -data FisxUser = FisxUser {name :: String} +data Lunch = Lunch {name :: String} deriving (Eq, Show, Generic) -instance ToSchema FisxUser +instance ToSchema Lunch -instance HasStatus FisxUser where - type StatusOf FisxUser = 203 +instance HasStatus Lunch where + type StatusOf Lunch = 200 -data ArianUser = ArianUser +data NoLunch = NoLunch deriving (Eq, Show, Generic) -instance ToSchema ArianUser +instance ToSchema NoLunch -type UVerbAPI = "fisx" :> UVerb 'GET '[JSON] '[FisxUser, WithStatus 303 String] - :<|> "arian" :> UVerb 'POST '[JSON] '[WithStatus 201 ArianUser] +instance HasStatus NoLunch where + type StatusOf NoLunch = 404 + +type UVerbAPI2 = + "lunch" :> UVerb 'GET '[JSON] '[Lunch, NoLunch] uverbSwagger :: Swagger -uverbSwagger = toSwagger (Proxy :: Proxy UVerbAPI) +uverbSwagger = toSwagger (Proxy :: Proxy UVerbAPI2) uverbAPI :: Value -uverbAPI = [aesonQQ| -{ - "swagger": "2.0", - "info": { - "version": "", - "title": "" - }, - "paths": { - "/fisx": { - "get": { - "produces": [ - "application/json;charset=utf-8" +uverbAPI = + [aesonQQ| + { + "swagger": "2.0", + "info": { + "version": "", + "title": "" + }, + "definitions": { + "Lunch": { + "required": [ + "name" ], - "responses": { - "303": { - "schema": { - "type": "string" - }, - "description": "" - }, - "203": { - "schema": { - "$ref": "#/definitions/FisxUser" - }, - "description": "" + "type": "object", + "properties": { + "name": { + "type": "string" } } + }, + "NoLunch": { + "type": "string", + "enum": [ + "NoLunch" + ] } }, - "/arian": { - "post": { - "produces": [ - "application/json;charset=utf-8" - ], - "responses": { - "201": { - "schema": { - "$ref": "#/definitions/ArianUser" + "paths": { + "/lunch": { + "get": { + "responses": { + "404": { + "schema": { + "$ref": "#/definitions/NoLunch" + }, + "description": "" }, - "description": "" - } + "200": { + "schema": { + "$ref": "#/definitions/Lunch" + }, + "description": "" + } + }, + "produces": [ + "application/json;charset=utf-8" + ] } } } - }, - "definitions": { - "FisxUser": { - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - }, - "type": "object" - }, - "ArianUser": { - "type": "string", - "enum": [ - "ArianUser" - ] - } - } } |] From 1bc98b2090fecb0676a46ea0050119872b744bc6 Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Thu, 12 Nov 2020 18:07:13 +0100 Subject: [PATCH 09/10] impor WithStatus only for ghc>=881 --- src/Servant/Swagger/Internal/Orphans.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Servant/Swagger/Internal/Orphans.hs b/src/Servant/Swagger/Internal/Orphans.hs index 1523dc317..3036ccdab 100644 --- a/src/Servant/Swagger/Internal/Orphans.hs +++ b/src/Servant/Swagger/Internal/Orphans.hs @@ -10,7 +10,9 @@ import Data.Proxy import Data.Swagger import Servant.Types.SourceT (SourceT) +#if __GLASGOW_HASKELL__ >= 881 import Servant.API (WithStatus(..)) +#endif -- | Pretend that 'SourceT m a' is '[a]'. -- From a9de7c6703d3e34f4527fbde526bdbac10c53eba Mon Sep 17 00:00:00 2001 From: Stefan Matting Date: Tue, 17 Nov 2020 14:05:40 +0100 Subject: [PATCH 10/10] bump version to 1.1.11 --- servant-swagger.cabal | 2 +- src/Servant/Swagger/Internal/Orphans.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/servant-swagger.cabal b/servant-swagger.cabal index 962311412..96212880b 100644 --- a/servant-swagger.cabal +++ b/servant-swagger.cabal @@ -1,5 +1,5 @@ name: servant-swagger -version: 1.1.10 +version: 1.1.11 synopsis: Generate a Swagger/OpenAPI/OAS 2.0 specification for your servant API. description: Swagger is a project used to describe and document RESTful APIs. The core of the diff --git a/src/Servant/Swagger/Internal/Orphans.hs b/src/Servant/Swagger/Internal/Orphans.hs index 3036ccdab..acd2f4232 100644 --- a/src/Servant/Swagger/Internal/Orphans.hs +++ b/src/Servant/Swagger/Internal/Orphans.hs @@ -21,7 +21,7 @@ import Servant.API (WithStatus(..)) instance ToSchema a => ToSchema (SourceT m a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy [a]) --- @since #if __GLASGOW_HASKELL__ >= 881 +-- @since 1.1.11 deriving instance ToSchema a => ToSchema (WithStatus s a) #endif