Skip to content

Commit

Permalink
chore: revert to include check for empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieKimani1 committed Mar 4, 2025
1 parent 0805d89 commit 0a690ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Microsoft.OpenApi/Models/OpenApiSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ private void SerializeAsV2(
// readOnly
// In V2 schema if a property is part of required properties of parent schema,
// it cannot be marked as readonly.
if (propertyName is not null && !parentRequiredProperties.Contains(propertyName))
if (!string.IsNullOrEmpty(propertyName) && propertyName is not null && !parentRequiredProperties.Contains(propertyName))
{
writer.WriteProperty(name: OpenApiConstants.ReadOnly, value: ReadOnly, defaultValue: false);
}
Expand Down

0 comments on commit 0a690ff

Please sign in to comment.