We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0805d89 commit 0a690ffCopy full SHA for 0a690ff
src/Microsoft.OpenApi/Models/OpenApiSchema.cs
@@ -715,7 +715,7 @@ private void SerializeAsV2(
715
// readOnly
716
// In V2 schema if a property is part of required properties of parent schema,
717
// it cannot be marked as readonly.
718
- if (propertyName is not null && !parentRequiredProperties.Contains(propertyName))
+ if (!string.IsNullOrEmpty(propertyName) && propertyName is not null && !parentRequiredProperties.Contains(propertyName))
719
{
720
writer.WriteProperty(name: OpenApiConstants.ReadOnly, value: ReadOnly, defaultValue: false);
721
}
0 commit comments