Skip to content

Conversation

@perkops
Copy link
Member

@perkops perkops commented Dec 5, 2025

Summary

Major upgrade to .NET 10 with significant improvements to validation, API documentation, sample project architecture, and code quality.

🚀 .NET 10 Migration

  • Upgrade target framework from .NET 9 to .NET 10
  • Update LangVersion to 14.0
  • Migrate solution files from .sln to .slnx format
  • Upgrade CI/CD pipelines for .NET 10 compatibility
  • Bump library version to 2.0

✨ New Features

Validation Enhancements

  • Add nested [FromBody] property validation with automatic validator discovery
  • Prevent duplicate key errors in validation error merging
  • Add bounds checking and null guards throughout validation pipeline

API Documentation

  • Add Scalar API reference alongside Swagger UI
  • Update Swagger filters for Microsoft.OpenApi v2.x compatibility
  • Fix enum type lookup for duplicate names across assemblies

Sample Project

  • Add Aspire AppHost for orchestration
  • Add Blazor Web UI project with MudBlazor
  • Add health check endpoint
  • Implement partial updates (PATCH-like behavior) for UpdateUser
  • Add Gender validation with FluentValidation

🐛 Bug Fixes

Middleware

  • Prevent header modification after response started
  • Skip error response for canceled requests
  • Produce valid JSON in error responses
  • Add request path as Instance in ProblemDetails
  • Add exception mappings for ArgumentException and TimeoutException

Validation

  • Handle Activator.CreateInstance exceptions gracefully
  • Use FirstOrDefault to avoid exception with multiple parameter matches
  • Add null checks for dynamic type creation

Sample Project

  • Fix nullable handling in request/response models
  • Change DI lifetime from Singleton to Scoped for handlers and DbContext (thread-safety)
  • Add try-catch for SaveChangesAsync in all handlers
  • Add Mapster mappings for Address and Country entities
  • Use Uri.TryCreate to prevent UriFormatException

🧪 Tests

  • Migrate to Microsoft.Testing.Platform and xUnit v3
  • Add unit tests for Swagger filters
  • Add unit tests for EndpointDefinitionExtensions
  • Add validation merge tests

📚 Documentation

  • Expand README with validation, Scalar, and .NET 10 guidance
  • Fix incorrect class names and duplicate code in examples

🔧 Code Quality

  • Adopt primary constructors throughout codebase
  • Upgrade NuGet packages and analyzers
  • Enable Atc.Analyzer
  • Consolidate coding rules

Breaking Changes

  • Minimum target framework is now .NET 10
  • Library version bumped to 2.0
  • Microsoft.OpenApi v2.x compatibility changes in Swagger filters

Per Kops added 30 commits November 18, 2025 14:18
…et packages and target .NET 10, update coding rules
…emblies

Use DocumentFilterContext to build schema-to-type mapping instead of AppDomain scanning, enabling correct enum description generation when multiple assemblies define enums with identical names.
Per Kops added 23 commits December 5, 2025 15:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the library from .NET 8/9 to .NET 10, bumps the major version to 2.0, and introduces significant enhancements including nested [FromBody] validator discovery, Scalar API documentation, improved error handling, and comprehensive test coverage.

Key Changes:

  • Upgrade to .NET 10 with LangVersion 14.0 and migration from .sln to .slnx format
  • Add nested [FromBody] property validation with automatic validator discovery
  • Introduce Scalar API reference UI alongside Swagger, with OpenAPI 3.1 support
  • Migrate testing infrastructure to Microsoft.Testing.Platform and xUnit v3

Reviewed changes

Copilot reviewed 100 out of 100 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
version.json Bumped library version from 1.0 to 2.0
Directory.Build.props Updated TargetFramework to net10.0 and LangVersion to 14.0
test/Directory.Build.props Added Microsoft.Testing.Platform dependencies and xUnit v3 packages
src/Atc.Rest.MinimalApi/Middleware/GlobalErrorHandlingMiddleware.cs Added OperationCanceledException handling, response started checks, and valid JSON generation
src/Atc.Rest.MinimalApi/Filters/Swagger/SwaggerEnumDescriptionsDocumentFilter.cs Fixed enum type lookup for duplicate names and updated for Microsoft.OpenApi v2.x
src/Atc.Rest.MinimalApi/Filters/Endpoints/ValidationFilter.cs Added nested [FromBody] property validation with automatic validator discovery
src/Atc.Rest.MinimalApi/Extensions/ValidationProblemExtensions.cs Fixed validation error merging to prevent duplicate keys
src/Atc.Rest.MinimalApi/Atc.Rest.MinimalApi.csproj Updated to net10.0 and upgraded NuGet packages including Scalar.AspNetCore
sample/src/Demo.AppHost/* Added Aspire AppHost project for orchestration
sample/src/Demo.Web/* Added Blazor Web UI with MudBlazor for CRUD operations demo
sample/src/Demo.Domain/Validators/UpdateUserRequestValidator.cs Implemented partial update validation (PATCH-like behavior)
README.md Expanded documentation with .NET 10 guidance, Scalar setup, and nested validation examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@davidkallesen davidkallesen merged commit f8389bc into main Dec 5, 2025
4 checks passed
@davidkallesen davidkallesen deleted the feature/dotnet10support branch December 5, 2025 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants