git.iko.soy/typeable/openapi3
on master help sign in
Add ToSchema instances for Monoid newtypes
9949477Nickolay Kudasov
src/Data/Swagger/Schema/Internal.hs+8
@@ -99,6 +99,14 @@ instance ToSchema a => ToSchema (Set a) where
99
99
100instance ToSchema a => ToSchema (HashSet a) where toSchema _ = toSchema (Proxy :: Proxy (Set a))
100instance ToSchema a => ToSchema (HashSet a) where toSchema _ = toSchema (Proxy :: Proxy (Set a))
101
101
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+
102toSchemaBoundedIntegral :: forall a proxy. (Bounded a, Integral a) => proxy a -> Schema
110toSchemaBoundedIntegral :: forall a proxy. (Bounded a, Integral a) => proxy a -> Schema
103toSchemaBoundedIntegral _ = mempty
111toSchemaBoundedIntegral _ = mempty
104 & schemaType .~ SchemaInteger
112 & schemaType .~ SchemaInteger