Skip to content

Initial Minimal API Integration#8

Merged
feO2x merged 19 commits intomainfrom
7-minimal-api-serialization
Jan 17, 2026
Merged

Initial Minimal API Integration#8
feO2x merged 19 commits intomainfrom
7-minimal-api-serialization

Conversation

@feO2x
Copy link
Copy Markdown
Owner

@feO2x feO2x commented Jan 17, 2026

Closes #7

This pull request introduces a new ASP.NET Core Minimal APIs integration for the Light.Results library, enabling seamless conversion of result types to Minimal API responses and enhancing HTTP error handling. It also adds new projects and updates solution organization, along with documentation improvements and configuration tweaks.

ASP.NET Core Minimal APIs Integration:

  • Added new project Light.Results.AspNetCore.MinimalApis with extension methods (MinimalApiResultExtensions) to convert Result and Result<T> to Minimal API IResult responses, including enriched error handling and ProblemDetails conversion.
  • Introduced LightProblemDetailsResult, a high-performance RFC 7807/9457-compliant Problem Details implementation for Minimal APIs, avoiding unnecessary allocations.
  • Added a factory abstraction (IResultFactory and DefaultResultFactory) for customizable result-to-response conversion, supporting dependency injection and options. [1] [2]

Solution and Project Structure:

  • Updated .editorconfig to include .slnx files for consistent formatting.
  • Extended the solution file (Light.Results.slnx) to include new projects for Minimal APIs and shared ASP.NET Core logic, as well as related test projects and documentation files.
  • Added new project files for Light.Results.AspNetCore.MinimalApis and its shared components.

Documentation and Rules:

  • Moved and expanded the general rules and project guidelines into a new agents.md file at the root, clarifying coding standards and project setup.
  • Removed the now-redundant rules section from .windsurf/rules/general-rules.md.

feO2x added 17 commits January 15, 2026 07:45
…ght.Results.AspNetCore.Shared

Signed-off-by: Kenny Pflug <[email protected]>
…nSerializerContext again, refactored LightProblemDetailsResultJsonConverter

Signed-off-by: Kenny Pflug <[email protected]>
…dd additional comments about perf

Signed-off-by: Kenny Pflug <[email protected]>
@feO2x feO2x requested a review from Copilot January 17, 2026 07:00
@feO2x feO2x self-assigned this Jan 17, 2026
@feO2x feO2x linked an issue Jan 17, 2026 that may be closed by this pull request
Copy link
Copy Markdown

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 introduces ASP.NET Core Minimal APIs integration for the Light.Results library, enabling conversion of Result types to HTTP responses with RFC 7807/9457-compliant Problem Details serialization. The implementation prioritizes performance by avoiding ASP.NET Core's ProblemDetails.Extensions dictionary allocations and using source-generated JSON serialization.

Changes:

  • Added new Light.Results.AspNetCore.MinimalApis and Light.Results.AspNetCore.Shared projects with extension methods for converting Result types to Minimal API responses
  • Introduced LightProblemDetailsResult for high-performance Problem Details responses and enrichment infrastructure
  • Enhanced core library with HTTP status code mapping, error category extensions, and covariant interface support

Reviewed changes

Copilot reviewed 90 out of 90 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Light.Results.AspNetCore.MinimalApis/ New Minimal APIs integration with ToMinimalApiResult extensions, LightProblemDetailsResult, and JSON serialization
src/Light.Results.AspNetCore.Shared/ Shared code for ASP.NET Core integrations including enrichment, serialization, and HTTP context injection
src/Light.Results/ Core enhancements: HTTP extensions, GetLeadingCategory method, covariant interface support
tests/Light.Results.Tests/ Added explicit Xunit imports removing global usings, new HTTP-related tests
tests/Light.Results.AspNetCore.*.Tests/ Comprehensive test coverage for new ASP.NET Core integrations
agents.md, .editorconfig Documentation and configuration updates

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

Comment thread tests/Light.Results.Tests/ErrorsEnumeratorTests.cs
Comment thread src/Light.Results/Errors.cs
@feO2x feO2x merged commit 47d5238 into main Jan 17, 2026
1 check passed
@feO2x feO2x deleted the 7-minimal-api-serialization branch January 17, 2026 07:22
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.

ASP.NET Core Minimal API Serialization for Light.Results

2 participants