git.iko.soy/typeable/openapi3
on master help sign in
Add ToSchema instances for Monoid newtypes
commit99494778ed7cb2dcc5d7c7565f30bda3261dbf7f authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateMon 23 Nov 2015, 17:56 (11 years ago) parentc0d1d78
1 file changed+8
src/Data/Swagger/Schema/Internal.hs+8
src/Data/Swagger/Schema/Internal.hs+8
@@ -99,6 +99,14 @@ instance ToSchema a => ToSchema (Set a) where
9999
100100instance ToSchema a => ToSchema (HashSet a) where toSchema _ = toSchema (Proxy :: Proxy (Set a))
101101
102+instance ToSchema All where toSchema _ = toSchema (Proxy :: Proxy Bool)
103+instance ToSchema Any where toSchema _ = toSchema (Proxy :: Proxy Bool)
104+instance ToSchema a => ToSchema (Sum a) where toSchema _ = toSchema (Proxy :: Proxy a)
105+instance ToSchema a => ToSchema (Product a) where toSchema _ = toSchema (Proxy :: Proxy a)
106+instance ToSchema a => ToSchema (First a) where toSchema _ = toSchema (Proxy :: Proxy a)
107+instance ToSchema a => ToSchema (Last a) where toSchema _ = toSchema (Proxy :: Proxy a)
108+instance ToSchema a => ToSchema (Dual a) where toSchema _ = toSchema (Proxy :: Proxy a)
109+
102110toSchemaBoundedIntegral :: forall a proxy. (Bounded a, Integral a) => proxy a -> Schema
103111toSchemaBoundedIntegral _ = mempty
104112 & schemaType .~ SchemaInteger