@@ -22,6 +22,9 @@
2222-- Validate JSON values with Swagger Schema.
2323module Data.Swagger.Internal.Schema.Validation where
2424
25+import Prelude ()
26+import Prelude.Compat
27+
2528import Control.Applicative
2629import Control.Lens
2730import Control.Monad (when)
@@ -34,8 +37,6 @@ import Data.HashMap.Strict (HashMap)
3437import qualified Data.HashMap.Strict as HashMap
3538import qualified Data.HashMap.Strict.InsOrd as InsOrdHashMap
3639import qualified "unordered-containers" Data.HashSet as HashSet
37−import Data.List (intercalate)
38−import Data.Monoid
3940import Data.Proxy
4041import Data.Scientific (Scientific, isInteger)
4142import Data.Text (Text)
@@ -483,7 +484,7 @@ validateSchemaType value = withSchema $ \sch ->
483484 (Nothing, String s) -> sub_ paramSchema (validateString s)
484485 (Nothing, Array xs) -> sub_ paramSchema (validateArray xs)
485486 (Nothing, Object o) -> validateObject o
486− param@(t, _) -> invalid $ "expected JSON value of type " ++ showType param
487+ bad -> invalid $ "expected JSON value of type " ++ showType bad
487488
488489validateParamSchemaType :: Value -> Validation (ParamSchema t) ()
489490validateParamSchemaType value = withSchema $ \sch ->
@@ -498,8 +499,7 @@ validateParamSchemaType value = withSchema $ \sch ->
498499 (Nothing, Number n) -> validateNumber n
499500 (Nothing, String s) -> validateString s
500501 (Nothing, Array xs) -> validateArray xs
501− (t, _) -> invalid $ "expected JSON value of type " ++ show t
502− param@(t, _) -> invalid $ "expected JSON value of type " ++ showType param
502+ bad -> invalid $ "expected JSON value of type " ++ showType bad
503503
504504showType :: (Maybe (SwaggerType t), Value) -> String
505505showType (Just type_, _) = show type_