@@ -9,9 +9,11 @@ module Data.Swagger.Schema.Internal where
10import Control.Lens
10import Control.Lens
11import Data.Aeson
11import Data.Aeson
12import Data.Monoid
13import Data.Monoid
13import Data.Proxy
14import Data.Proxy
14import qualified Data.Text as Text
15import qualified Data.Text as Text
15import GHC.Generics
17import GHC.Generics
17import Data.Swagger.Internal
19import Data.Swagger.Internal
@@ -40,7 +42,17 @@ instance ToSchema Bool where
40instance ToSchema Integer where
42instance ToSchema Integer where
41 toSchema _ = mempty { _schemaType = SchemaInteger }
43 toSchema _ = mempty { _schemaType = SchemaInteger }
45+instance ToSchema Int where toSchema = toSchemaBoundedIntegral
46+instance ToSchema Int8 where toSchema = toSchemaBoundedIntegral
47+instance ToSchema Int16 where toSchema = toSchemaBoundedIntegral
48+instance ToSchema Int32 where toSchema = toSchemaBoundedIntegral
49+instance ToSchema Int64 where toSchema = toSchemaBoundedIntegral
51+instance ToSchema Word where toSchema = toSchemaBoundedIntegral
52+instance ToSchema Word8 where toSchema = toSchemaBoundedIntegral
53+instance ToSchema Word16 where toSchema = toSchemaBoundedIntegral
54+instance ToSchema Word32 where toSchema = toSchemaBoundedIntegral
43−instance ToSchema Int where toSchema = toSchemaBoundedIntegral
55+instance ToSchema Word64 where toSchema = toSchemaBoundedIntegral
45instance ToSchema Double where
57instance ToSchema Double where
46 toSchema _ = mempty { _schemaType = SchemaNumber }
58 toSchema _ = mempty { _schemaType = SchemaNumber }