git.iko.soy/typeable/openapi3
on master help sign in
Add instances for Identity.
commit13b9d0a54437c09756df3bab25b59bc3dd5014c0 authorTristan Seligmann <mithrandi@mithrandi.net> dateMon 4 Sep 2017, 03:37 (9 years ago) parentdebefe1
2 files changed+4
src/Data/Swagger/Internal/ParamSchema.hs+2 src/Data/Swagger/Internal/Schema.hs+2
src/Data/Swagger/Internal/ParamSchema.hs+2
@@ -225,6 +225,8 @@ instance ToParamSchema a => ToParamSchema (First a) where toParamSchema _ = to
225225instance ToParamSchema a => ToParamSchema (Last a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
226226instance ToParamSchema a => ToParamSchema (Dual a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
227227
228+instance ToParamSchema a => ToParamSchema (Identity a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
229+
228230instance ToParamSchema a => ToParamSchema [a] where
229231 toParamSchema _ = mempty
230232 & type_ .~ SwaggerArray
src/Data/Swagger/Internal/Schema.hs+2
@@ -562,6 +562,8 @@ instance ToSchema a => ToSchema (First a) where declareNamedSchema _ = unname
562562instance ToSchema a => ToSchema (Last a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
563563instance ToSchema a => ToSchema (Dual a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
564564
565+instance ToSchema a => ToSchema (Identity a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy a)
566+
565567-- | Default schema for @'Bounded'@, @'Integral'@ types.
566568--
567569-- >>> encode $ toSchemaBoundedIntegral (Proxy :: Proxy Int16)