Skip to content

Commit 0a690ff

Browse files
committed
chore: revert to include check for empty strings
1 parent 0805d89 commit 0a690ff

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
@@ -715,7 +715,7 @@ private void SerializeAsV2(
715715
// readOnly
716716
// In V2 schema if a property is part of required properties of parent schema,
717717
// it cannot be marked as readonly.
718-
if (propertyName is not null && !parentRequiredProperties.Contains(propertyName))
718+
if (!string.IsNullOrEmpty(propertyName) && propertyName is not null && !parentRequiredProperties.Contains(propertyName))
719719
{
720720
writer.WriteProperty(name: OpenApiConstants.ReadOnly, value: ReadOnly, defaultValue: false);
721721
}

0 commit comments

Comments
 (0)