Skip to content

fix(csharp): preserve operation server paths - #25548

Open
AndreyVMarkelov wants to merge 1 commit into
OpenAPITools:masterfrom
AndreyVMarkelov:andreymarkelov/fix-csharp-operation-server-path
Open

AndreyVMarkelov wants to merge 1 commit into
OpenAPITools:masterfrom
AndreyVMarkelov:andreymarkelov/fix-csharp-operation-server-path

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #25546

For C# generichost operations with their own server, append the operation path to the server base path and preserve an explicit port. Path parameter substitution remains in place.

Tests

  • Added a focused generator regression test with a server base path, port, and path parameter.
  • Verified a generated client sends https://example.com:8443/base/files/hello%20world through a local handler; before the fix it threw UriFormatException.
  • Regenerated the C# generichost samples and built the .NET 10 Petstore sample.
  • Verified the full public Dropbox C# client builds and uses the expected upload/download paths with this change and [BUG][C#] Generic host loses object oneOf values during serialization #25547's fix applied locally.

Summary by cubic

Fixes C# generichost operations with per-operation servers so the operation path is appended to the server base path and explicit ports are preserved, which previously caused UriFormatException at runtime.

  • Uses Host and Port separately instead of Authority, which lost explicit ports and produced invalid URIs.
  • Appends the operation path to the server base path, keeping the server's base path intact.
  • Adds a regression test covering a server with a base path, port, and path parameter, and regenerates all C# generichost samples.

Written for commit 4d5408b. Summary will update on new commits.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 21 files

View guided diff | Re-trigger cubic

This branch has not been deployed

No deployments
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.

[BUG][C#] Generic host omits operation path when operation has server

1 participant