Skip to content

Create an analyzer to help verify and fix endpoint metadata of minimal APIs #34543

@DamianEdwards

Description

@DamianEdwards

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:1Work that is critical for the release, but we could probably ship withoutarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etccost: LWill take from 5 - 10 days to completefeature-minimal-actionsController-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

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions