ASP.NET API Versioning

repository·main·Indexed 25 days ago

https://github.com/dotnet/aspnet-api-versioning

A library for adding API versioning semantics to REST services built with ASP.NET, including support for ASP.NET Core (Minimal APIs and MVC), ASP.NET Web API, and OData. It provides tools for OpenAPI documentation, version-aware HTTP clients, and supports both attribute-based and convention-based versioning metadata.

Tokens
3.9K
Snippets
0
Records
43
Agent score
85%

What's inside ASP.NET API Versioning

  1. Overview of ASP.NET API Versioning for Minimal APIs

    main

    ASP.NET API versioning provides a method for adding versioning semantics to REST services built with ASP.NET Core.

    Important Note on Package Selection:

    • Use the Asp.Versioning.Http package (this repository) if you are working with Minimal APIs.
    • Use the Asp.Versioning.Mvc package if you require additional functionality specifically for ASP.NET Core MVC.
  2. Overview of Asp.Versioning.WebApi.OData.ApiExplorer

    main
    Asp.Versioning.WebApi.OData.ApiExplorer provides API version-aware extensions for API Explorer in ASP.NET Web API with OData v4.0. These extensions are designed to assist with scenarios such as test automation and OpenAPI document generation by making the API Explorer aware of versioning semantics. This package is the successor to Microsoft.AspNet.OData.Versioning.ApiExplorer.
  3. Overview of ASP.NET API Versioning

    main
    ASP.NET API versioning provides a method for adding API versioning semantics to REST services built with ASP.NET. It uses metadata attributes and conventions to describe which API versions are implemented by your services. The Asp.Versioning.Abstractions package contains the primary abstractions used to build both server-side and client-side versioning applications.
  4. Use Asp.Versioning.OData.ApiExplorer for API Explorer support in OData v4.0

    main

    The Asp.Versioning.OData.ApiExplorer package provides API version-aware extensions for API Explorer in ASP.NET Core MVC and OData v4.0. This is useful for scenarios such as test automation or generating OpenAPI documents that correctly reflect API versioning semantics in OData services.

    Note: This package was formerly known as Microsoft.AspNetCore.OData.Versioning.ApiExplorer.

  5. Use Asp.Versioning.WebApi.ApiExplorer for API discovery

    main

    The Asp.Versioning.WebApi.ApiExplorer package provides API version-aware extensions for the ASP.NET Web API Explorer. It is designed to help tools like OpenAPI (Swagger) document generators or test automation frameworks discover and understand which API versions are implemented by your services.

    Note: This package was formerly known as Microsoft.AspNet.WebApi.Versioning.ApiExplorer.

  6. Use Asp.Versioning.Grpc.ApiExplorer for gRPC API versioning support

    main
    The Asp.Versioning.Grpc.ApiExplorer package provides API version-aware extensions for API Explorer in gRPC services. This is useful for scenarios such as test automation or generating OpenAPI documents that need to account for API versioning semantics. While designed to work with ASP.NET API Versioning, it also supports API Explorer features even when versioning is not implemented.
  7. Apply API version metadata using conventions in ASP.NET Core with OData

    main
    You can apply API version metadata to your ASP.NET Core controllers using conventions instead of decorating them with attributes. This is particularly useful when you want to avoid decorating controllers directly or when working in a plugin-based architecture where you cannot modify the controller source code. This example demonstrates how to integrate these conventions with OData.
  8. Use API version metadata with OData conventions

    main
    Instead of decorating controllers with attributes, you can apply API version metadata using conventions. This is particularly useful when you want to avoid decorating controllers directly or when working in a plugin-based model where you cannot modify the controller source code. This example demonstrates how to integrate ASP.NET Core with OData using this convention-based approach.