Skip to content

Move unified validation APIs to separate package #62071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented May 22, 2025

This PR moves the validation APIs from the Http.Abstractions package to a new Microsoft.Extensions.Validation package to support using the unified resolver APIs in more scenarios.

The changes include:

  • Created new directory structure:

    • src/Validation/src for the core library
    • src/Validation/test/Microsoft.Extensions.Validation.Tests for tests
    • src/Validation/gen for the source generator
    • src/Validation/test/Microsoft.Extensions.Validation.ValidationsGenerator.Tests for generator tests
  • Moved validation source files and updated namespaces:

    • Changed from Microsoft.AspNetCore.Http.Validation to Microsoft.Extensions.Validation
    • Maintained the same API contracts and functionality
  • Added type forwarders to maintain backward compatibility:

    • Added forwarding for all validation types in Http.Abstractions
    • Added forwarding for the validations generator to the new implementation
  • Created appropriately structured project files with dependencies

  • Updated project references and configuration

This change supports better modularity by decoupling validation logic from the HTTP abstractions, allowing it to be used more broadly in other scenarios while maintaining backward compatibility.

Fixes #62070.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits May 22, 2025 16:12
Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Move unified validation APIs to separate package Move unified validation APIs to separate package May 22, 2025
@Copilot Copilot AI requested a review from captainsafia May 22, 2025 16:22
@captainsafia
Copy link
Member

@copilot Remove the type-forwards and delete the old versions of the code that you moved.

Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented May 22, 2025

@copilot Remove the type-forwards and delete the old versions of the code that you moved.

I've removed all type forwards and deleted the original validation code files as requested in commit 93c627c. This included:

  1. Removing ForwardingValidationDirectives.cs from Http.Abstractions
  2. Removing all validation code files from Http.Abstractions/src/Validation/
  3. Removing ValidationsGeneratorForwarding.cs from Http.Extensions
  4. Removing all validation generator code from Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator
  5. Updating the PublicAPI.Unshipped.txt file to remove validation API entries

Projects that previously referenced these validation types will now need to reference the new Microsoft.Extensions.Validation package directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move unified validation APIs to separate package
2 participants