chore: upgrade Asp.Versioning.Mvc to v10.0.0

Đang mở
#165 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
csharp, openapi
Lĩnh vực
backend-api-design

Hướng nghiên cứu

First check whether Asp.Versioning.OpenApi has reached a stable NuGet release; the issue says to wait until it has. Then review TaskFlow.Api.csproj, Extensions/ApiVersioningServiceExtensions.cs, Extensions/OpenApiServiceExtensions.cs, and Program.cs for the versioning and OpenAPI wiring. Verify the Scalar UI, version tagged OpenAPI output, test suite, and vulnerable package report against the acceptance criteria.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

blocked

On hold (2026-10-30), part of #372 (Move to .NET 11). Verified from the NuGet nuspecs: Asp.Versioning.OpenApi 10.2.3 depends on Microsoft.OpenApi [2.7.5, 3.0.0) and on Microsoft.AspNetCore.OpenApi 10.0.10, and Asp.Versioning.Mvc 10.2.1 targets net10.0 only. The 2.7.5 pin in this repo satisfies that range, so the migration itself should resolve cleanly on .NET 10. But the <3.0.0 cap is exactly what #301 has to get past: Microsoft.AspNetCore.OpenApi 11.x needs Microsoft.OpenApi 3.10.2 or later. Adopting Asp.Versioning.OpenApi now would block the .NET 11 move until Asp.Versioning ships a release that accepts Microsoft.OpenApi 3.x. 8.1.1 works on .NET 10, so there is no urgency. Take this with the .NET 11 move, or when such a release exists, whichever is first.

Background

Asp.Versioning.Mvc and Asp.Versioning.Mvc.ApiExplorer were held at 8.1.1 in #164 (backend NuGet dependency audit). The 10.x line carries breaking changes to OpenAPI wiring that require a dedicated migration.

Update (2026-10-12): the prerequisite is met. Asp.Versioning.OpenApi now has stable releases, and the latest versions on NuGet are:

Package Currently pinned Latest stable
Asp.Versioning.Mvc 8.1.1 10.2.1
Asp.Versioning.Mvc.ApiExplorer 8.1.1 10.2.1
Asp.Versioning.OpenApi (new) not referenced 10.2.3

The original target of 10.0.0 is superseded. Target the latest stable release, and review the changelogs between 10.0.0 and 10.2.x for further breaking changes.

What needs to change

Version 10 changes how OpenAPI integration is wired:

  • The old pattern (services.AddOpenApi("v1", options => ...) from Microsoft.AspNetCore) is replaced by a fluent chain: AddApiVersioning().AddApiExplorer().AddOpenApi()
  • app.MapOpenApi() must be replaced by app.MapOpenApi().WithDocumentPerVersion()
  • The custom ApiVersionDocumentTransformer in Extensions/OpenApiServiceExtensions.cs may need to be adapted or replaced by the new VersionedOpenApiOptions surface
  • A new companion package Asp.Versioning.OpenApi is required

Things to watch

  • Microsoft.OpenApi is pinned to 2.7.5 to resolve CVE-2026-49451 (commit 0c60491). Confirm Asp.Versioning.OpenApi resolves cleanly with that pin and that the CVE stays fixed (dotnet list package --vulnerable).
  • Current wiring: Program.cs calls AddApiVersioningConfiguration() and OpenApiServiceExtensions.AddOpenApi(...), and app.UseOpenApiWithScalar().

Files likely affected

  • TaskFlow.Api/TaskFlow.Api.csproj — add Asp.Versioning.OpenApi, bump Asp.Versioning.Mvc and Asp.Versioning.Mvc.ApiExplorer to the latest stable (10.2.1)
  • TaskFlow.Api/Extensions/ApiVersioningServiceExtensions.cs
  • TaskFlow.Api/Extensions/OpenApiServiceExtensions.cs
  • TaskFlow.Api/Program.cs (if MapOpenApi call needs updating)

Acceptance criteria

  • Asp.Versioning.OpenApi is at a stable release (10.2.3 as of 2026-10-12)
  • Asp.Versioning.Mvc and Asp.Versioning.Mvc.ApiExplorer updated to the latest stable (10.2.1)
  • Scalar UI at /scalar/v1 renders correctly with API version selection working
  • Generated OpenAPI JSON is valid and version-tagged
  • npm run gen:api still produces a working client (the generator reads the live OpenAPI spec)
  • All backend tests pass (dotnet test) and dotnet format --verify-no-changes is clean
  • dotnet list package --vulnerable reports zero findings
Ngôn ngữ chính
C#
Star
1
Fork
0
Merge trung bình
2 giờ 2 phút
Pull request đã merge (30 ngày)
98

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nevridge/TaskFlow

Tất cả issue của nevridge/TaskFlow

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.