Skip to content

chore: migrate sample API and .NET client to .NET 11 (blocked by OData 9) - #9364

Merged
Vincent Biret (baywet) merged 9 commits into
mainfrom
upgrade/sample-api-net11
Nov 11, 2026
Merged

Vincent Biret (baywet) merged 9 commits into
mainfrom
upgrade/sample-api-net11

Conversation

@baywet

@baywet Vincent Biret (baywet) commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Migrate the sample API, its integration tests and all sample clients to current tooling:

API changes

  • ToDoItemsController is a regular [ApiController]. Routes stay the same: GET/POST /ToDoItems, GET/PATCH/DELETE /ToDoItems/{id}.
  • Filtering: the clients only used OData $select, which is uncommon in plain REST APIs. GET /ToDoItems now accepts an optional isComplete query parameter instead, and the client samples demo filtering with it.
  • List response: a plain JSON array. No client used nextLink or the value wrapper beyond reading the items.
  • PATCH: takes a ToDoItemUpdate model with nullable properties (replacing Delta<T>). Only the provided properties are applied.
  • POST: returns 201 with a Location header.
  • OpenAPI: the description is generated by Microsoft.AspNetCore.OpenApi, pinned to OpenAPI 3.1 (.NET 11 defaults to 3.2), and still served at /openapi/openapi.yaml.
    • Strict JSON number handling stops integers from being described as integer | string.
    • Response content types are explicit.
  • Packages removed: Microsoft.AspNetCore.OData, Microsoft.OData.Core, Microsoft.OData.ModelBuilder, Microsoft.OpenApi.OData, Swashbuckle.AspNetCore and the direct Microsoft.OpenApi reference.

Client changes

Client Changes
dotnet Uses Microsoft.Kiota.Bundle (the generated client needs the multipart serializer) plus Microsoft.Kiota.Authentication.Azure 2.1.6.
Go Kiota Go libraries updated to latest (abstractions 1.12.1, http 1.6.1, …), plus the multipart serializer. type maps to SetTypeEscaped.
Java Kiota Java 1.10.5 with multipart serializer and jakarta.annotation-api 3.0.0. App code moved to the synchronous Kiota Java API. makesdk.bat was missing the generate verb. commons-text 1.15.0, junit-jupiter 6.1.3, azure-identity pinned to 1.19.0.
TypeScript Kiota TS packages are ESM-only, so the project is now ESM (type: module, nodenext, output in dist/). Uses @microsoft/kiota-bundle (DefaultRequestAdapter) and the interface/factory model style. ts-node and isomorphic-fetch removed (Node has native fetch). @types/node added.

Integrated Dependabot branches

These branches were merged locally into this branch, preserving their commits. The original pull requests were not merged, closed or edited:

These are references only, not closing keywords.

Local validation

  • API tests: dotnet test passes 8/8 (.NET SDK 11.0.100). The tests now cover isComplete filtering, the Location header on create, and the OpenAPI document shape.
  • Live run: ran the API locally and generated all four clients from https://localhost:7206/openapi/openapi.yaml.
  • Client builds:
    • dotnet: build passes with 0 warnings.
    • Go: go build and go vet pass.
    • TypeScript: tsc passes and prettier is clean.
    • Java: gradle build passes (JDK 21, gradle:9-jdk21 container).
  • Not run: the client apps against Entra (they require an interactive device-code sign-in).
  • Outdated packages: dotnet list package --outdated reports no outdated packages for API, tests or client, and none are vulnerable. go list -m -u shows no outdated direct Go modules.
  • npm majors not taken: npm outdated shows only major dev-tool bumps (TypeScript 7, ESLint 10), which are out of scope here.
  • Formatting: dotnet format applied to changed C# files.

This checkout sits under another repository's configuration. Local SDK commands used -p:ManagePackageVersionsCentrally=false, and tests ran from outside the parent tree. These environment-specific overrides are not added to CI.

dependabot Bot and others added 7 commits November 10, 2026 21:16
---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Configuration.Binder
  dependency-version: 11.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Configuration.Json
  dependency-version: 11.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
---
updated-dependencies:
- dependency-name: Microsoft.OData.Core
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 26ff6e74-45c7-4932-bfa8-11c1c74d16e1
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 26ff6e74-45c7-4932-bfa8-11c1c74d16e1
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 26ff6e74-45c7-4932-bfa8-11c1c74d16e1
Update CI and current direct dependencies, remove incompatible Upgrade Assistant analyzers, and add an OpenAPI endpoint regression test.

The OpenAPI test intentionally reproduces microsoft/OpenAPI.NET.OData#937; keep this migration draft until upstream OData 9 compatibility is available.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 26ff6e74-45c7-4932-bfa8-11c1c74d16e1
The OpenAPI YAML writer quotes the version (openapi: '3.1.2'). Verified against microsoft/OpenAPI.NET.OData#940.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 26ff6e74-45c7-4932-bfa8-11c1c74d16e1
- rewrite ToDoItemsController as an [ApiController] with an isComplete
  query filter and a plain JSON array list response
- use a ToDoItemUpdate model for PATCH instead of Delta<T>
- generate the OpenAPI 3.1 description with Microsoft.AspNetCore.OpenApi
  at the same /openapi/openapi.yaml URL and drop all OData packages
- regenerate the dotnet, go, java and typescript clients with Kiota 1.38
  and update the client apps (filter demo replaces select)
- move clients to current Kiota dependencies (dotnet/TS bundle, TS ESM)

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 26ff6e74-45c7-4932-bfa8-11c1c74d16e1
@baywet
Vincent Biret (baywet) marked this pull request as ready for review November 11, 2026 19:50
@baywet
Vincent Biret (baywet) requested a review from a team as a code owner November 11, 2026 19:50
@baywet
Vincent Biret (baywet) merged commit 0b01d3f into main Nov 11, 2026
40 checks passed
@baywet
Vincent Biret (baywet) deleted the upgrade/sample-api-net11 branch November 11, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant