@@ -3,13 +3,11 @@
33{-# LANGUAGE DataKinds #-}
44{-# LANGUAGE FlexibleContexts #-}
55{-# LANGUAGE FlexibleInstances #-}
6−{-# LANGUAGE OverloadedLists #-}
76{-# LANGUAGE OverloadedStrings #-}
87{-# LANGUAGE PolyKinds #-}
98{-# LANGUAGE RankNTypes #-}
109{-# LANGUAGE ScopedTypeVariables #-}
1110{-# LANGUAGE TypeOperators #-}
12−{-# LANGUAGE TypeFamilies #-}
1311#if __GLASGOW_HASKELL__ >= 806
1412{-# LANGUAGE UndecidableInstances #-}
1513#endif
@@ -32,13 +30,11 @@ import qualified Data.Swagger as Swagger
3230import Data.Swagger.Declare
3331import Data.Text (Text)
3432import qualified Data.Text as Text
35−import GHC.Generics (D1, Meta(..), Rep)
3633import GHC.TypeLits
3734import Network.HTTP.Media (MediaType)
3835import Servant.API
3936import Servant.API.Description (FoldDescription,
4037 reflectDescription)
41−import Servant.API.Generic (ToServantApi, AsApi)
4238import Servant.API.Modifiers (FoldRequired)
4339
4440import Servant.Swagger.Internal.TypeLevel.API
@@ -153,10 +149,6 @@ mkEndpointNoContentVerb path _ = mempty
153149addParam :: Param -> Swagger -> Swagger
154150addParam param = allOperations.parameters %~ (Inline param :)
155151
156−-- | Add a tag to every operation in the spec.
157−addTag :: Text -> Swagger -> Swagger
158−addTag tag = allOperations.tags %~ ([tag] <>)
159−
160152-- | Add accepted content types to every operation in the spec.
161153addConsumes :: [MediaType] -> Swagger -> Swagger
162154addConsumes cs = allOperations.consumes %~ (<> Just (MimeList cs))
@@ -447,9 +439,6 @@ instance (ToSchema a, Accept ct, HasSwagger sub, KnownSymbol (FoldDescription mo
447439 & required ?~ True
448440 & schema .~ ParamBody ref
449441
450−instance (HasSwagger (ToServantApi routes), KnownSymbol datatypeName, Rep (routes AsApi) ~ D1 ('MetaData datatypeName moduleName packageName isNewtype) f) => HasSwagger (NamedRoutes routes) where
451− toSwagger _ = addTag (Text.pack $ symbolVal (Proxy :: Proxy datatypeName)) (toSwagger (Proxy :: Proxy (ToServantApi routes)))
452−
453442-- =======================================================================
454443-- Below are the definitions that should be in Servant.API.ContentTypes
455444-- =======================================================================