-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Create an analyzer to help verify and fix endpoint metadata of minimal APIs #34543
Copy link
Copy link
Closed
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etccost: LWill take from 5 - 10 days to completeWill take from 5 - 10 days to completefeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone
Metadata
Metadata
Assignees
Labels
Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etccost: LWill take from 5 - 10 days to completeWill take from 5 - 10 days to completefeature-minimal-actionsController-like actions for endpoint routingController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
ApiExplorerand 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.