I am trying to enable swagger in my application, but as I am retrofitting it to legacy applications I would like to know exactly what changes I am making.
On the internet it suggests adding the following to make the Swagger endpoints appear
builder.Services.AddApiVersioning(opt =>
{
opt.UseApiBehavior = false;
});
This property makes the endpoints appear, which is great. But I cant find any information on what this property is actually doing.
Is it changing the way my endpoints behave in any way or just exposing them for Swagger to read?
Visual studio comment on the method says:
Gets or sets a value indicating whether to use web API behaviors. True to use web API behaviors; otherwise, false. The default value is true When this property is set to true, API versioning policies only apply to controllers that remain after the IApiControllerFilter has been applied. When this property is set to false API versioning policies are considers for all controllers. This was default behavior behavior in previous versions
But I'm not sure what is meant when it talks about "APIVersioningPolicies only apply"
I cant find any information about the property in the Versioning wiki page https://github.com/dotnet/aspnet-api-versioning/wiki/API-Versioning-Options
I am cautious because I dont want to introduce any breaking changes