@@ -18,8 +18,9 @@ checkToSchema proxy js = toSchema proxy <~> js
19spec :: Spec
19spec :: Spec
21− describe "Generic ToSchema" $
21+ describe "Generic ToSchema" $ do
22 context "Person" $ checkToSchema (Proxy :: Proxy Person) personSchemaJSON
22 context "Person" $ checkToSchema (Proxy :: Proxy Person) personSchemaJSON
23+ context "ISPair" $ checkToSchema (Proxy :: Proxy ISPair) ispairSchemaJSON
24main :: IO ()
25main :: IO ()
25main = hspec spec
26main = hspec spec
@@ -43,3 +44,19 @@ personSchemaJSON = [aesonQQ|
43 "required": ["name", "phone"]
44 "required": ["name", "phone"]
48+data ISPair = ISPair Integer String
49+ deriving (Generic, ToSchema)
51+ispairSchemaJSON :: Value
52+ispairSchemaJSON = [aesonQQ|
57+ { "type": "integer" },