Skip to content

Replace deprecated Microsoft.Extensions.ApiDescription.Client with NSwag CLI tooling #258

Description

@ddemeyer

Context

PR #249 surfaced a build warning: Microsoft.Extensions.ApiDescription.Client is deprecated as of .NET 10 Preview 7.

Scope

Two projects reference the deprecated package (both at v8.0.8):

  • Source/ISHRemote/Trisoft.ISHRemote.OpenApiAM10/Trisoft.ISHRemote.OpenApiAM10.csproj
  • Source/ISHRemote/Trisoft.ISHRemote.OpenApiISH30/Trisoft.ISHRemote.OpenApiISH30.csproj

Both also reference NSwag.ApiDescription.Client v14.1.0 — the actual C# code-generation engine. That package is not deprecated and remains the target toolchain.

Decision: stay with NSwag, not Kiota

Microsoft's breaking-change doc lists NSwag as a supported migration target. Kiota is Microsoft's newer alternative but generates a fundamentally different client architecture (fluent request-builder pattern, System.Text.Json, different exception types) — adopting it would require rewriting every cmdlet that calls IshSession.OpenApiISH30Client or IshSession.OpenApiAM10Client, which is a breaking internal change. Aligning to NSwag CLI tooling preserves the generated output unchanged.

Work items

  1. Remove <PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="8.0.8" /> from both .csproj files.
  2. Extract the inline <Options> currently embedded in each <OpenApiReference> item into standalone .nswag config files alongside each OpenApi*.json spec.
  3. Add a pre-build or CI step that invokes dotnet tool run nswag run <config.nswag> (or npx nswag run) to regenerate the clients before compilation.
  4. Confirm the generated obj/OpenApi*Client.cs output is identical to today — no cmdlet code changes should be necessary.
  5. Update any build or developer-setup documentation that describes how client generation works.

Out of scope

Migration to Kiota is explicitly excluded. It may be revisited as a separate, future major-version initiative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions