git.iko.soy/typeable/openapi3
on master help sign in
Add instances for Identity.
13b9d0aTristan Seligmann
src/Data/Swagger/Internal/ParamSchema.hs+2
@@ -225,6 +225,8 @@ instance ToParamSchema a => ToParamSchema (First a) where toParamSchema _ = to
225instance ToParamSchema a => ToParamSchema (Last a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
225instance ToParamSchema a => ToParamSchema (Last a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
226instance ToParamSchema a => ToParamSchema (Dual a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
226instance ToParamSchema a => ToParamSchema (Dual a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
227
227
228+instance ToParamSchema a => ToParamSchema (Identity a) where toParamSchema _ = toParamSchema (Proxy :: Proxy a)
229+
228instance ToParamSchema a => ToParamSchema [a] where
230instance ToParamSchema a => ToParamSchema [a] where
229 toParamSchema _ = mempty
231 toParamSchema _ = mempty
230 & type_ .~ SwaggerArray
232 & type_ .~ SwaggerArray
src/Data/Swagger/Internal/Schema.hs+2
@@ -562,6 +562,8 @@ instance ToSchema a => ToSchema (First a) where declareNamedSchema _ = unname
562instance ToSchema a => ToSchema (Last a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
562instance ToSchema a => ToSchema (Last a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
563instance ToSchema a => ToSchema (Dual a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
563instance ToSchema a => ToSchema (Dual a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
564
564
565+instance ToSchema a => ToSchema (Identity a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy a)
566+
565-- | Default schema for @'Bounded'@, @'Integral'@ types.
567-- | Default schema for @'Bounded'@, @'Integral'@ types.
566--
568--
567-- >>> encode $ toSchemaBoundedIntegral (Proxy :: Proxy Int16)
569-- >>> encode $ toSchemaBoundedIntegral (Proxy :: Proxy Int16)