Merge pull request #116 from mithrandi/identity-instances
Add Identity instances
commit9f92754dda952466aa05dc45f8592eb6c10cf7c1
authorNickolay Kudasov <fizruk@users.noreply.github.com>
dateSun 10 Sep 2017, 13:57 (9 years ago)
parent7e551052e25e83
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
@@ -565,6 +565,8 @@ instance ToSchema a => ToSchema (First a) where declareNamedSchema _ = unname
565565instance ToSchema a => ToSchema (Last a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
566566instance ToSchema a => ToSchema (Dual a) where declareNamedSchema _ = unname <$> declareNamedSchema (Proxy :: Proxy a)
567567
568+instance ToSchema a => ToSchema (Identity a) where declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy a)
569+
568570-- | Default schema for @'Bounded'@, @'Integral'@ types.
569571--
570572-- >>> encode $ toSchemaBoundedIntegral (Proxy :: Proxy Int16)
stack.yaml+1−1
@@ -1,3 +1,3 @@
1−resolver: lts-8.0
1+resolver: lts-9.3
22packages:
33- '.'