fix: Add JSON string enum converter for Issue Management API

- Configure AddControllers() with JsonStringEnumConverter
- Allows API to accept Issue type/priority/status as strings ("Story", "High", "Backlog")
- Frontend can now send readable enum values instead of integers
- All Issue Management CRUD operations tested and working

Test results:
- Create Issue (Story, Bug, Task) ✓
- List all issues ✓
- Filter by status (Backlog, InProgress) ✓
- Change issue status (Kanban workflow) ✓
- Update issue details ✓
- Multi-tenant isolation verified ✓
This commit is contained in:
Yaojia Wang
2025-11-04 12:04:57 +01:00
parent 6b11af9bea
commit 1246445a0b
7 changed files with 835 additions and 23 deletions

View File

@@ -44,8 +44,12 @@ builder.Services.Configure<Microsoft.AspNetCore.ResponseCompression.GzipCompress
options.Level = System.IO.Compression.CompressionLevel.Fastest;
});
// Add controllers
builder.Services.AddControllers();
// Add controllers with JSON string enum converter
builder.Services.AddControllers()
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.Converters.Add(new System.Text.Json.Serialization.JsonStringEnumConverter());
});
// Configure exception handling (IExceptionHandler - .NET 8+)
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();