Swashbuckle.AspNetCore icon indicating copy to clipboard operation
Swashbuckle.AspNetCore copied to clipboard

Bug: readOnly is set to true on Schema but this is not reflected in Swagger file

Open wyatt-troia-msft opened this issue 3 years ago • 2 comments

Version: 6.1.4

I have some model properties annotated with [SwaggerSchema(ReadOnly = true)]. When I debug and inspect the OpenAPISchema property corresponding to one of these model properties, its readOnly property is set to true, as expected. Yet these properties are not marked as readOnly in the produced Swagger file (the readOnly key doesn't appear at all for them).

I am using NewtonSoft as my serializer and have followed the instructions for handling this in the README.

wyatt-troia-msft avatar Sep 13 '21 22:09 wyatt-troia-msft