-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
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.