typespec icon indicating copy to clipboard operation
typespec copied to clipboard

[Bug]: Duplicate base path in generated RestClient URLs when server template contains path segments

Open radhgupta opened this issue 11 months ago • 0 comments

Describe the bug

When the server URL template contains a base path (e.g., {endpoint}/contentsafety), the generated RestClient duplicates the base path in the request URL.

Example:

Server template: {endpoint}/contentsafety Operation path: /text:analyze Expected URL: {endpoint}/contentsafety/text:analyze Actual URL: {endpoint}/contentsafety/contentsafety/text:analyze

Reproduction

  1. Use the http-client-csharp generator to generate code for the Azure.AI.ContentSafety service
  2. Examine the generated ContentSafetyClient.cs file
  3. Observe that RestClient URLs contain duplicate /contentsafety base path:
  • Expected: {endpoint}/contentsafety/text:analyze
  • Actual: {endpoint}/contentsafety/contentsafety/text:analyze

Checklist

radhgupta avatar Dec 17 '25 17:12 radhgupta