on master help sign in
Separate producer and consumer definitions for schemata
commit45df05878216f373dff68872395baab7df12f583 authormniip <mniip@mniip.com> dateWed 7 Apr 2021, 23:09 (6 years ago) parent3b839cb
1 file changed+5−5
src/OpenAPI/Checker/Validate/Schema.hs+5−5
src/OpenAPI/Checker/Validate/Schema.hs+5−5
@@ -617,7 +617,7 @@ checkFormulas env tr (ProdCons (fp, ep) (fc, ec)) =
617617 [F.for_ cs $ checkImplication env ps | Conjunct cs <- S.toList css]
618618
619619checkContradiction :: [Traced OpenApi (Condition t)] -> CompatFormula s ()
620−checkContradiction = undefined -- TODO
620+checkContradiction _ = pure () -- TODO
621621
622622checkImplication
623623 :: (HasAll (CheckEnv Schema) xs, Typeable t)
@@ -760,11 +760,11 @@ instance Subtree Schema where
760760 | InvalidSchema Text
761761 | NoMatchingCondition [SomeCondition]
762762 deriving stock (Eq, Ord, Show)
763− type CheckEnv Schema = '[Definitions Schema]
763+ type CheckEnv Schema = '[ProdCons (Definitions Schema)]
764764 normalizeTrace = undefined
765765 checkCompatibility env schs = withTrace $ \traces -> do
766766 let defs = getH env
767− checkFormulas env (producer traces) $ schemaToFormula defs <$> (Traced <$> traces <*> schs)
767+ checkFormulas env (producer traces) $ schemaToFormula <$> defs <*> (Traced <$> traces <*> schs)
768768
769769instance Subtree (Referenced Schema) where
770770 data CheckIssue (Referenced Schema)
@@ -774,7 +774,7 @@ instance Subtree (Referenced Schema) where
774774 checkCompatibility env refs = withTrace $ \traces -> do
775775 let
776776 defs = getH env
777− schs = dereference defs <$> refs
777+ schs = dereference <$> defs <*> refs
778778 schs' = retrace <$> traces <*> schs
779779 localTrace (getTrace <$> schs) $ do
780− checkFormulas env (producer $ getTrace <$> schs') $ schemaToFormula defs <$> schs'
780+ checkFormulas env (producer $ getTrace <$> schs') $ schemaToFormula <$> defs <*> schs'