@@ -18,8 +18,9 @@ checkToSchema proxy js = toSchema proxy <~> js
1818
1919spec :: Spec
2020spec = do
21− describe "Generic ToSchema" $
21+ describe "Generic ToSchema" $ do
2222 context "Person" $ checkToSchema (Proxy :: Proxy Person) personSchemaJSON
23+ context "ISPair" $ checkToSchema (Proxy :: Proxy ISPair) ispairSchemaJSON
2324
2425main :: IO ()
2526main = hspec spec
@@ -43,3 +44,19 @@ personSchemaJSON = [aesonQQ|
4344 "required": ["name", "phone"]
4445}
4546|]
47+
48+data ISPair = ISPair Integer String
49+ deriving (Generic, ToSchema)
50+
51+ispairSchemaJSON :: Value
52+ispairSchemaJSON = [aesonQQ|
53+{
54+ "type": "array",
55+ "items":
56+ [
57+ { "type": "integer" },
58+ { "type": "string" }
59+ ]
60+}
61+|]
62+