feat: disallow null on schema

This commit is contained in:
Fernando Araoz 2025-01-12 16:09:25 -05:00
parent d43d4fa190
commit 8666e9a051
2 changed files with 11 additions and 1 deletions

View File

@ -29,4 +29,10 @@ public class WeatherForecastController : ControllerBase
})
.ToArray();
}
[HttpPost]
public void Post(WeatherForecast forecast)
{
Console.WriteLine("Inserting!!! :D");
}
}

View File

@ -20,7 +20,11 @@ builder.Services.AddDbContext<ApplicationDbContext>(options =>
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSwaggerGen(options =>
{
options.SupportNonNullableReferenceTypes();
}
);
var app = builder.Build();