git.iko.soy/typeable/swagger2
on master help sign in
Use Proxy3 instead of undefined
commit474cbdaf130e05d00c761e00e25fe9de70050f92 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateMon 23 Nov 2015, 19:39 (11 years ago) parent80fedd0
1 file changed+5−2
src/Data/Swagger/Schema/Internal.hs+5−2
src/Data/Swagger/Schema/Internal.hs+5−2
@@ -2,6 +2,7 @@
22{-# LANGUAGE FlexibleContexts #-}
33{-# LANGUAGE FlexibleInstances #-}
44{-# LANGUAGE KindSignatures #-}
5+{-# LANGUAGE PolyKinds #-}
56{-# LANGUAGE ScopedTypeVariables #-}
67{-# LANGUAGE TypeOperators #-}
78{-# LANGUAGE TypeSynonymInstances #-}
@@ -149,7 +150,7 @@ instance {-# OVERLAPPING #-} (Selector s, ToSchema c) => GToSchema (S1 s (K1 i (
149150 & schemaType .~ SchemaObject
150151 & schemaProperties . at fieldName ?~ Inline fieldSchema
151152 where
152− fieldName = T.pack (fieldLabelModifier opts (selName (undefined :: S1 s f p)))
153+ fieldName = T.pack (fieldLabelModifier opts (selName (Proxy3 :: Proxy3 s f p)))
153154 fieldSchema = toSchema (Proxy :: Proxy c)
154155
155156-- | Record fields.
@@ -163,9 +164,11 @@ instance {-# OVERLAPPABLE #-} (Selector s, GToSchema f) => GToSchema (S1 s f) wh
163164 & schemaProperties . at fieldName ?~ Inline fieldSchema
164165 & schemaRequired %~ (fieldName :)
165166 where
166− fieldName = T.pack (fieldLabelModifier opts (selName (undefined :: S1 s f p)))
167+ fieldName = T.pack (fieldLabelModifier opts (selName (Proxy3 :: Proxy3 s f p)))
167168 fieldSchema = gtoSchema opts (Proxy :: Proxy f) mempty
168169
169170instance ToSchema c => GToSchema (K1 i c) where
170171 gtoSchema _ _ _ = toSchema (Proxy :: Proxy c)
171172
173+data Proxy3 a b c = Proxy3
174+