Create an analyzer to help verify and fix endpoint metadata of minimal APIs #34543
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
cost: L
Will take from 5 - 10 days to complete
feature-minimal-actions
Controller-like actions for endpoint routing
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Priority:1
Work that is critical for the release, but we could probably ship without
Milestone
When authoring minimal APIs it might not be obvious that endpoint metadata can be defined for the APIs (via extension methods or attributes) that will help to accurately describe them in
ApiExplorer
and in turn OpenAPI documents generated by libraries like Swashbuckle.Similar to the existing analyzer in MVC today, we could create an analyzer for minimal APIs that alerts the user when it detects that what a minimal API actually returns doesn't match what it's defined to return in its metadata. The analyzer could then offer a quick-fix to bring them inline.
This analyzer could potentially form the basis of a future source generator (see #34544) that automatically registers the metadata for minimal APIs based on what it detects they actually return.
The text was updated successfully, but these errors were encountered: