Added swagger decoration, reorganized controller elements for better clarity, renamed entity index endpoint for better clarity

This commit is contained in:
2025-12-29 13:56:44 +01:00
parent c3dfe1a964
commit 625019f9f4
7 changed files with 178 additions and 77 deletions

View File

@@ -9,6 +9,7 @@ using Server.Helper;
using Server.Models;
using Server.Services;
using System.Text.Json.Serialization;
using System.Reflection;
var builder = WebApplication.CreateBuilder(args);
@@ -37,7 +38,12 @@ builder.Services.AddScoped<LocalizationService>();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSwaggerGen(c =>
{
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
c.IncludeXmlComments(xmlPath);
});
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(builder.Configuration)
.CreateLogger();