Skip to content

OpenAPI Source Generation MVC Customization#48

Merged
feO2x merged 2 commits into
mainfrom
47-openapi-source-generation-mvc-customization
May 23, 2026
Merged

OpenAPI Source Generation MVC Customization#48
feO2x merged 2 commits into
mainfrom
47-openapi-source-generation-mvc-customization

Conversation

@feO2x
Copy link
Copy Markdown
Owner

@feO2x feO2x commented May 23, 2026

Closes #47

Implemented as stated in the corresponding issue.

feO2x added 2 commits May 23, 2026 08:42
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
… MVC endpoint-local customization

Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
@feO2x feO2x self-assigned this May 23, 2026
@feO2x feO2x added the enhancement New feature or request label May 23, 2026
@feO2x feO2x linked an issue May 23, 2026 that may be closed by this pull request
9 tasks
@feO2x feO2x requested a review from Copilot May 23, 2026 08:49
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Light.PortableResults 96% 94% 2301
Light.PortableResults.AspNetCore.MinimalApis 93% 80% 24
Light.PortableResults.AspNetCore.Mvc 93% 80% 24
Light.PortableResults.AspNetCore.OpenApi 93% 74% 518
Light.PortableResults.AspNetCore.Shared 100% 100% 26
Light.PortableResults.Validation 96% 89% 1757
Light.PortableResults.Validation.OpenApi 98% 90% 105
Light.PortableResults.Validation.OpenApi.SourceGeneration 88% 83% 755
Summary 95% (9356 / 9872) 89% (3950 / 4446) 5510

Minimum allowed line rate is 60%

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

Adds an additive, attribute-friendly MVC customization path for generated validation OpenAPI metadata by introducing a second, two-contract MVC attribute that mirrors Minimal API ordering (generated validator contract first, endpoint-local customization second).

Changes:

  • Added ProducesPortableValidationProblemForAttribute<TValidator, TEndpointContract> for MVC to apply generated metadata and then append endpoint-local builder customizations.
  • Added unit + integration tests to verify metadata arrays append (rather than replace) and to assert MVC behavior matches an equivalent Minimal API configure callback.
  • Updated README and added an implementation plan doc for issue #47.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Light.PortableResults.Validation.OpenApi.Tests/ValidationOpenApiAttributeTests.cs Adds a unit test proving endpoint-local contract metadata is appended after the generated contract.
tests/Light.PortableResults.Validation.OpenApi.Tests/GeneratedValidationOpenApiIntegrationTests.cs Adds an integration test comparing MVC two-contract attribute output to an equivalent Minimal API customization.
src/Light.PortableResults.Validation.OpenApi/ProducesPortableValidationProblemForAttribute.cs Introduces the new two-contract MVC attribute and applies contracts in the intended order using a shared builder.
README.md Documents the new MVC customization pattern alongside the existing Minimal API callback customization.
ai-plans/0047-openapi-source-generation-mvc-customization.md Adds the plan/acceptance-criteria document corresponding to issue #47.

@feO2x feO2x merged commit 94af880 into main May 23, 2026
3 checks passed
@feO2x feO2x deleted the 47-openapi-source-generation-mvc-customization branch May 23, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI Source Generation MVC Customization

2 participants