Skip to content

Commit 7b33c1d

Browse files
committed
Merge with outer if statement
1 parent 8037531 commit 7b33c1d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Microsoft.OpenApi/Validations/Rules/RuleHelpers.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,9 @@ public static void ValidateDataTypeMismatch(
5858

5959
// Before checking the type, check first if the schema allows null.
6060
// If so and the data given is also null, this is allowed for any type.
61-
if (nullable)
61+
if (nullable && jsonElement.ValueKind is JsonValueKind.Null)
6262
{
63-
if (jsonElement.ValueKind is JsonValueKind.Null)
64-
{
65-
return;
66-
}
63+
return;
6764
}
6865

6966
if (type == "object")

0 commit comments

Comments
 (0)