You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- A required field on the left when additionalProperties are forbidden on the right means the sets are disjoint
513
-
if lval.required && not radd then
514
-
Ok()
515
-
516
-
else
517
-
prev
502
+
in
503
+
FastDict.merge
504
+
(\_ lval ->
505
+
CliMonad.map
506
+
(\prev ->
507
+
prev
508
+
||-- A required field on the left when additionalProperties are forbidden on the right means the sets are disjoint
509
+
(lval.required && not radd)
518
510
)
519
-
(\_ lval rval prev ->
520
-
case prev of
521
-
Ok()->
522
-
prev
523
-
524
-
Err warns ->
525
-
-- If the field is optional in both we could have a value without it, so it's not enough to distinguish, so we ask it's required in at least one of them
526
-
if lval.required || rval.required then
527
-
let
528
-
( res, newWarns )=
529
-
areTypesDisjoint lval.type_ rval.type_
530
-
in
531
-
if res then
532
-
Ok()
533
-
534
-
else
535
-
Err(warns ++ newWarns)
536
-
537
-
else
538
-
prev
511
+
)
512
+
(\_ lval rval ->
513
+
CliMonad.andThen
514
+
(\prev ->
515
+
if not prev &&(lval.required || rval.required)then
516
+
-- If the field is optional in both we could have a value without it, so it's not enough to distinguish, so we ask it's required in at least one of them
517
+
areTypesDisjoint lval.type_ rval.type_
518
+
519
+
else
520
+
CliMonad.succeed prev
539
521
)
540
-
(\_ rval prev ->
541
-
case prev of
542
-
Ok()->
543
-
prev
544
-
545
-
Err _ ->
546
-
-- A required field on the right when additionalProperties are forbidden on the left means the sets are disjoint
547
-
if rval.required && not ladd then
548
-
Ok()
549
-
550
-
else
551
-
prev
522
+
)
523
+
(\_ rval ->
524
+
CliMonad.map
525
+
(\prev ->
526
+
prev
527
+
||-- A required field on the right when additionalProperties are forbidden on the left means the sets are disjoint
528
+
(rval.required && not ladd)
552
529
)
553
-
ldict
554
-
rdict
555
-
(Err[])
556
-
in
557
-
case merged of
558
-
Ok()->
559
-
CliMonad.succeed True
560
-
561
-
Err warns ->
562
-
warns
563
-
|>Set.fromList
564
-
|>Set.foldl
565
-
CliMonad.withWarning
566
-
(CliMonad.succeed False)
530
+
)
531
+
ldict
532
+
rdict
533
+
(CliMonad.succeed False)
567
534
)
568
535
(schemaToProperties qualify l)
569
536
(schemaToProperties qualify r)
@@ -603,29 +570,31 @@ type SimplifiedForDisjointBasicType
0 commit comments