Description
Currently the Server project is making use of legacy APIs for the API Explorer and Swagger
|
builder.Services.AddEndpointsApiExplorer(); |
|
builder.Services.AddSwaggerGen(c => |
|
{ |
|
// Include XML comments for all included assemblies |
|
Directory.EnumerateFiles(AppContext.BaseDirectory, "*.xml") |
|
.Where(x => x.Contains("MyExtensionsApp._1") |
|
&& File.Exists(Path.Combine( |
|
AppContext.BaseDirectory, |
|
$"{Path.GetFileNameWithoutExtension(x)}.dll"))) |
|
.ToList() |
|
.ForEach(path => c.IncludeXmlComments(path)); |
|
}); |
|
|
|
var app = builder.Build(); |
|
|
|
// Configure the HTTP request pipeline. |
|
if (app.Environment.IsDevelopment()) |
|
{ |
|
app.UseSwagger(); |
|
app.UseSwaggerUI(); |
|
} |
This should be updated with net9.0 to use the OpenAPI extension and as it seems the more popular one these days is Scalar this should also be updated accordingly.
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
app.MapScalarApiReference(o =>
{
o.EnabledClients = [
ScalarClient.HttpClient,
ScalarClient.Http11,
ScalarClient.JQuery,
ScalarClient.Xhr
];
});
}
Description
Currently the Server project is making use of legacy APIs for the API Explorer and Swagger
uno.templates/src/Uno.Templates/content/unoapp/MyExtensionsApp.1.Server/Program.cs
Lines 40 to 60 in de938ef
This should be updated with net9.0 to use the OpenAPI extension and as it seems the more popular one these days is Scalar this should also be updated accordingly.