Skip to content

[V2] OpenApi Schema are not serialized with ReadOnly property for 2.0 documents when the schema is not a property.Β #2272

@andrueastman

Description

@andrueastman

See test at https://github.com/microsoft/OpenAPI.NET.OData/blob/a578631d9a7ff4bb2590e8cf1d0c3291cce48fdf/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs#L982

This is a regression of the NRT work at #2146

That updated this check that no longer allows writing ReadOnly when the propertyName is not set.

if (!string.IsNullOrEmpty(propertyName) && propertyName is not null && !parentRequiredProperties.Contains(propertyName))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions