@@ -25,6 +25,7 @@ module Data.OpenApi.Internal.Schema.Validation where
26import Prelude ()
26import Prelude ()
27import Prelude.Compat
27import Prelude.Compat
29import Control.Applicative
30import Control.Applicative
30import Control.Lens hiding (allOf)
31import Control.Lens hiding (allOf)
@@ -472,7 +473,7 @@ validateSchemaType val = withSchema $ \sch ->
472 res <- forM variants $ \var ->
473 res <- forM variants $ \var ->
473 (True <$ validateWithSchemaRef var val) <|> (return False)
474 (True <$ validateWithSchemaRef var val) <|> (return False)
474 case length $ filter id res of
475 case length $ filter id res of
475− 0 -> invalid $ "Value not valid under any of 'oneOf' schemas: " ++ show val
476+ 0 -> traceShow (val, variants) $ invalid $ "Value not valid under any of 'oneOf' schemas: " ++ show val
476 1 -> valid
477 1 -> valid
477 _ -> invalid $ "Value matches more than one of 'oneOf' schemas: " ++ show val
478 _ -> invalid $ "Value matches more than one of 'oneOf' schemas: " ++ show val
478 (view allOf -> Just variants) -> do
479 (view allOf -> Just variants) -> do