git.iko.soy/typeable/swagger2
on master help sign in
(squash-me) support GHC 7.x
9d0865bLucas DiCioccio
src/Data/Swagger/Internal/Schema.hs+1−4
@@ -44,6 +44,7 @@ import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
44import Data.Int
44import Data.Int
45import Data.IntSet (IntSet)
45import Data.IntSet (IntSet)
46import Data.IntMap (IntMap)
46import Data.IntMap (IntMap)
47+import Data.List.NonEmpty (NonEmpty)
47import Data.Map (Map)
48import Data.Map (Map)
48import Data.Proxy
49import Data.Proxy
49import Data.Scientific (Scientific)
50import Data.Scientific (Scientific)
@@ -73,7 +74,6 @@ import Data.Swagger.Internal.TypeShape
73#else
74#else
74import qualified Data.ByteString as BS
75import qualified Data.ByteString as BS
75import qualified Data.ByteString.Lazy as BSL
76import qualified Data.ByteString.Lazy as BSL
76−import Data.List.NonEmpty (NonEmpty)
77import GHC.TypeLits (TypeError, ErrorMessage(..))
77import GHC.TypeLits (TypeError, ErrorMessage(..))
78#endif
78#endif
79
79
@@ -562,14 +562,11 @@ instance ToSchema a => ToSchema (Set a) where
562
562
563instance ToSchema a => ToSchema (HashSet a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy (Set a))
563instance ToSchema a => ToSchema (HashSet a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy (Set a))
564
564
565−#if __GLASGOW_HASKELL__ < 800
566−#else
567instance ToSchema a => ToSchema (NonEmpty a) where
565instance ToSchema a => ToSchema (NonEmpty a) where
568 declareNamedSchema _ = do
566 declareNamedSchema _ = do
569 schema <- declareSchema (Proxy :: Proxy [a])
567 schema <- declareSchema (Proxy :: Proxy [a])
570 return $ unnamed $ schema
568 return $ unnamed $ schema
571 & minItems .~ Just 1
569 & minItems .~ Just 1
572−#endif
573
570
574instance ToSchema All where declareNamedSchema = plain . paramSchemaToSchema
571instance ToSchema All where declareNamedSchema = plain . paramSchemaToSchema
575instance ToSchema Any where declareNamedSchema = plain . paramSchemaToSchema
572instance ToSchema Any where declareNamedSchema = plain . paramSchemaToSchema
swagger2.cabal+2
@@ -71,6 +71,8 @@ library
71 , uuid-types >=1.0.2 && <1.1
71 , uuid-types >=1.0.2 && <1.1
72 if !impl(ghc >= 7.10)
72 if !impl(ghc >= 7.10)
73 build-depends: nats >=1.1.1 && <1.2
73 build-depends: nats >=1.1.1 && <1.2
74+ if !impl(ghc >= 8.0)
75+ build-depends: semigroups >= 0.18.3 && <0.19
74 default-language: Haskell2010
76 default-language: Haskell2010
75
77
76test-suite spec
78test-suite spec