-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Document validation support for minimal APIs #35090
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
Comments
@captainsafia ... I'll move this one as well. Dan would like to track each preview's work items on one issue for visibility to make sure nothing falls through the cracks. |
@guardrex Sure -- I surfaced this here since we'll want to track documenting this permanently as part of the minimal API docs before we GA. This is in addition to the point-in-time stuff for Preview 3 what's new. |
@wadepickett use Ctrl+Alt+G on the appropriate doc to add meta-data to this issue. |
How to implement custom validation error response? |
I gave it a try with preview 4. Validation only kicks in when endpoints are in the same assembly. Is there any workaround for minimal endpoints which are in a different project and properly identified by openApi and showing in swagger UI, etc.? Example: When having this in main project (where
When moving endpoint to another assembly, for example with an extension method, validation does not kick in.
In another project
|
In .NET 10 Preivew 3, we're introducing support for minimal API validation support.
I've created a sample repo and some notes on the implementation to serve as source material here: https://github.com/captainsafia/minapi-validation-support.
One thing to note is that this feature has a user-facing component for developers who are building minimal APIs and a framework component for developers who are building frameworks or their own validation libraries.
I think our first priority is developers building APIs since that's where the biggest product gap it exists.
The text was updated successfully, but these errors were encountered: