Skip to content

Treat ValidationAttribute on generic methods as Validated - #7

Merged
kzu merged 1 commit into
mainfrom
dev/custom
Oct 9, 2026
Merged

kzu merged 1 commit into
mainfrom
dev/custom

Conversation

@kzu

@kzu kzu commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Recognize a generic method annotated with any ValidationAttribute subclass as if it also had [Validated].
  • Register the closed type arguments and return type at each call site, including wrappers up to eight levels.

Test plan

  • Closure test: a custom ValidationAttribute on a generic factory and wrapper registers the closed return type.
  • Closure test: the same attribute on a non-generic method, and an unrelated attribute on a generic method, do not register closed types.
  • dotnet test (27 passed)

@kzu kzu added the enhancement New feature or request label Oct 9, 2026
@kzu
kzu enabled auto-merge (rebase) October 9, 2026 18:44
@kzu

kzu commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

27 passed 27 passed

🧪 Details on Ubuntu 24.04.5 LTS

from retest v1.1.0 on .NET 10.0.12 with 💜 by @devlooped

@kzu
kzu merged commit 23db85e into main Oct 9, 2026
4 checks passed
@kzu
kzu deleted the dev/custom branch October 9, 2026 18:45
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.

1 participant