Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
When a class has a property of type string?[], the generated OpenApi schema does not allow nulls.
Expected Behavior
The schema object should allow nulls in the array.
Steps To Reproduce
Minimal repro:
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenApi();
WebApplication app = builder.Build();
app.MapOpenApi();
app.MapGet("/weatherforecast", () =>
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast(["10", null, "30"])).ToArray();
});
app.Run();
internal record WeatherForecast(string?[] Temperature);
Exceptions (if any)
No response
.NET Version
9.0.2 and 10.0.100-preview.1.25120.13
Anything else?
Any ideas how to fix this with for example a schema transformer?