Skip to content

Microsoft.AspNetCore.OpenApi: Support API versioning (required for Swashbuckle feature parity)  #56314

@josundt

Description

@josundt

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

We currently use .NET 8.0/AspNetCore with Swashbuckle.AspNetCore in many APIs in our product ecosystem.
The current OpenApi documentations are very good with multiple API versions, good descriptions/comments, security defs/refs etc.

Swashbuckle.AspNetCore integrates with the package Asp.Versioning.Mvc.ApiExplorer to enable and simplify API versioning.
It augments SwashBuckle's capabilities (that we currently depend upon):

  • Tagging with Controllers/Action Methods with [ApiVersion("version")] attributes.
    These attributes add metadata describing in which version(s) the Controllers/ActonMethods are included.
  • Using special {version:apiVersion} route parameters that maps/has constraints to the tagged versions for Controller/ActionMethod.

Swashbuckle parses this metadata to enable splitting into multiple OpenApi documents - one JSON file per version.

I think the currently way of managing API versioning is simple and it works very well, and I hope the goal for Microsoft.AspNetCore.OpenApi is to get close to feature parity with Swashbuckle.AspNetCore and to make migration as easy as possible.

Describe the solution you'd like

This is a feature request to support API versioning, hopefully a similar way.
I don't know if you plan to integrate with Asp.Versioning.Mvc.ApiExplorer, but hope you can use similar concepts.

Can you ellaborate about the current plans to support API versioning?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions