Skip to content

Add proposal for async validation#363

Open
halter73 wants to merge 3 commits intomainfrom
halter73/async-validation
Open

Add proposal for async validation#363
halter73 wants to merge 3 commits intomainfrom
halter73/async-validation

Conversation

@halter73
Copy link
Member

@halter73 halter73 commented Mar 5, 2026

I'm just opening this temporarily for people to leave feedback. I plan to turn this into API Proposals for the runtime and aspnetcore repos. After that, I plan to close this without merging. Sorry if that's a misuse of this repo.

Comment on lines +331 to +332
### `IAsyncValidatableObject` Returns `IAsyncEnumerable`
Allows streaming results and is aligned with the pattern where validation may involve multiple async checks. If deemed too complex for V1, `Task<IEnumerable<ValidationResult>>` is an acceptable simplification.
Copy link
Member

@javiercn javiercn Mar 20, 2026

Choose a reason for hiding this comment

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

It's not directly related to this, but I think the way async validation will execute deserves more discussion. This has a big impact on the UX for UI frameworks, and can have very unpredictable outcomes in API contexts too.

Is the expectation that ValidateAsync will walk through the validations as it does today and await each async validation before triggering the next one?

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.

2 participants