Skip to content

Commit 081e251

Browse files
baywetandrueastman
andauthored
fix: null flag comparison
Co-authored-by: Andrew Omondi <[email protected]>
1 parent 3b3d0e6 commit 081e251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.OpenApi/Models/OpenApiSchema.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ private void SerializeTypeProperty(JsonSchemaType? type, IOpenApiWriter writer,
633633
{
634634
// check whether nullable is true for upcasting purposes
635635
var isNullable = Nullable ||
636-
Type is JsonSchemaType.Null ||
636+
(Type.HasValue && Type.Value.HasFlag(JsonSchemaType.Null)) ||
637637
Extensions is not null &&
638638
Extensions.TryGetValue(OpenApiConstants.NullableExtension, out var nullExtRawValue) &&
639639
nullExtRawValue is OpenApiAny { Node: JsonNode jsonNode} &&

0 commit comments

Comments
 (0)