docs: Add XML documentation comments to API layer

Add missing XML doc comments to resolve CS1591 warnings:

  - SerilogConfiguration: Class comment

  - SwaggerConfiguration: Class and AddSwaggerDocumentation() method

  - ExceptionHandlingMiddleware: Constructor and InvokeAsync() method

  - RequestLoggingMiddleware: Placeholder class comment

  - TenantResolutionMiddleware: Placeholder class comment

  - Program: Partial class comment for integration test access

Result: 0 CS1591 warnings in DocumentOperator.API project
This commit is contained in:
2026-07-07 18:56:23 +02:00
parent 8b154e7378
commit 077eb1e017
6 changed files with 33 additions and 3 deletions

View File

@@ -1,5 +1,8 @@
namespace DocumentOperator.API.Configuration namespace DocumentOperator.API.Configuration
{ {
/// <summary>
/// Placeholder class for Serilog configuration extensions.
/// </summary>
public class SerilogConfiguration public class SerilogConfiguration
{ {
} }

View File

@@ -3,8 +3,16 @@ using System.Reflection;
namespace DocumentOperator.API.Configuration namespace DocumentOperator.API.Configuration
{ {
/// <summary>
/// Provides extension methods for configuring Swagger/OpenAPI documentation.
/// </summary>
public static class SwaggerConfiguration public static class SwaggerConfiguration
{ {
/// <summary>
/// Adds Swagger documentation generation to the service collection.
/// </summary>
/// <param name="services">The service collection to add Swagger to.</param>
/// <returns>The modified service collection.</returns>
public static IServiceCollection AddSwaggerDocumentation(this IServiceCollection services) public static IServiceCollection AddSwaggerDocumentation(this IServiceCollection services)
{ {
services.AddSwaggerGen(options => services.AddSwaggerGen(options =>

View File

@@ -16,12 +16,21 @@ public class ExceptionHandlingMiddleware
private readonly RequestDelegate _next; private readonly RequestDelegate _next;
private readonly ILogger<ExceptionHandlingMiddleware> _logger; private readonly ILogger<ExceptionHandlingMiddleware> _logger;
/// <summary>
/// Initializes a new instance of the <see cref="ExceptionHandlingMiddleware"/> class.
/// </summary>
/// <param name="next">The next middleware in the pipeline.</param>
/// <param name="logger">The logger instance for exception logging.</param>
public ExceptionHandlingMiddleware(RequestDelegate next, ILogger<ExceptionHandlingMiddleware> logger) public ExceptionHandlingMiddleware(RequestDelegate next, ILogger<ExceptionHandlingMiddleware> logger)
{ {
_next = next; _next = next;
_logger = logger; _logger = logger;
} }
/// <summary>
/// Invokes the middleware to handle incoming HTTP requests and catch exceptions.
/// </summary>
/// <param name="context">The HTTP context for the current request.</param>
public async Task InvokeAsync(HttpContext context) public async Task InvokeAsync(HttpContext context)
{ {
try try

View File

@@ -1,5 +1,8 @@
namespace DocumentOperator.API.Middleware namespace DocumentOperator.API.Middleware
{ {
/// <summary>
/// Placeholder middleware for HTTP request/response logging.
/// </summary>
public class RequestLoggingMiddleware public class RequestLoggingMiddleware
{ {
} }

View File

@@ -1,5 +1,8 @@
namespace DocumentOperator.API.Middleware namespace DocumentOperator.API.Middleware
{ {
/// <summary>
/// Placeholder middleware for multi-tenancy resolution via X-API-Key header.
/// </summary>
public class TenantResolutionMiddleware public class TenantResolutionMiddleware
{ {
} }

View File

@@ -3,7 +3,6 @@ using DocumentOperator.Infrastructure.Configuration;
using DocumentOperator.Application; using DocumentOperator.Application;
using DocumentOperator.Infrastructure; using DocumentOperator.Infrastructure;
using DocumentOperator.API.Middleware; using DocumentOperator.API.Middleware;
using DocumentOperator.API.Endpoints.v1;
using DocumentOperator.API.Configuration; using DocumentOperator.API.Configuration;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@@ -41,6 +40,7 @@ try
builder.Services.AddApplication(); // Application Layer (MediatR, FluentValidation, Behaviors) builder.Services.AddApplication(); // Application Layer (MediatR, FluentValidation, Behaviors)
builder.Services.AddInfrastructure(); // Infrastructure Layer (DevExpress, Services) builder.Services.AddInfrastructure(); // Infrastructure Layer (DevExpress, Services)
builder.Services.AddControllers(); // Controllers (Controller-based API)
builder.Services.AddEndpointsApiExplorer(); builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerDocumentation(); builder.Services.AddSwaggerDocumentation();
@@ -67,9 +67,9 @@ try
app.UseHttpsRedirection(); app.UseHttpsRedirection();
// ======================================== // ========================================
// 6. Endpoints (Minimal API) // 6. Endpoints (Controller-based API)
// ======================================== // ========================================
app.MapDocumentEndpoints(); // POST /api/v1/documents/validate app.MapControllers(); // Maps all [ApiController] controllers
Log.Information("DocumentOperator API started successfully"); Log.Information("DocumentOperator API started successfully");
@@ -86,4 +86,8 @@ finally
} }
// Make Program class accessible for Integration Tests // Make Program class accessible for Integration Tests
/// <summary>
/// Entry point class for the DocumentOperator API.
/// Made partial and public for integration test access.
/// </summary>
public partial class Program { } public partial class Program { }