Skip to content

Commit bfe7b02

Browse files
fix(client): don't overzealously validate union variants when deserializing
1 parent 72b74d6 commit bfe7b02

File tree

108 files changed

+1434
-4302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1434
-4302
lines changed

src/Orb/Models/AdjustmentInterval.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,10 @@ JsonSerializerOptions options
556556
);
557557
if (deserialized != null)
558558
{
559-
deserialized.Validate();
560559
return new(deserialized, element);
561560
}
562561
}
563-
catch (System::Exception e)
564-
when (e is JsonException || e is OrbInvalidDataException)
562+
catch (JsonException)
565563
{
566564
// ignore
567565
}
@@ -579,12 +577,10 @@ JsonSerializerOptions options
579577
);
580578
if (deserialized != null)
581579
{
582-
deserialized.Validate();
583580
return new(deserialized, element);
584581
}
585582
}
586-
catch (System::Exception e)
587-
when (e is JsonException || e is OrbInvalidDataException)
583+
catch (JsonException)
588584
{
589585
// ignore
590586
}
@@ -602,12 +598,10 @@ JsonSerializerOptions options
602598
);
603599
if (deserialized != null)
604600
{
605-
deserialized.Validate();
606601
return new(deserialized, element);
607602
}
608603
}
609-
catch (System::Exception e)
610-
when (e is JsonException || e is OrbInvalidDataException)
604+
catch (JsonException)
611605
{
612606
// ignore
613607
}
@@ -624,12 +618,10 @@ JsonSerializerOptions options
624618
);
625619
if (deserialized != null)
626620
{
627-
deserialized.Validate();
628621
return new(deserialized, element);
629622
}
630623
}
631-
catch (System::Exception e)
632-
when (e is JsonException || e is OrbInvalidDataException)
624+
catch (JsonException)
633625
{
634626
// ignore
635627
}
@@ -646,12 +638,10 @@ JsonSerializerOptions options
646638
);
647639
if (deserialized != null)
648640
{
649-
deserialized.Validate();
650641
return new(deserialized, element);
651642
}
652643
}
653-
catch (System::Exception e)
654-
when (e is JsonException || e is OrbInvalidDataException)
644+
catch (JsonException)
655645
{
656646
// ignore
657647
}

0 commit comments

Comments
 (0)