Skip to content

feat(http-server-csharp): add exclude-interfaces option to skip controller generation - #11495

Draft
abatishchev with Copilot wants to merge 3 commits into
mainfrom
copilot/featurehttp-server-csharp-disable-operations-contr
Draft

feat(http-server-csharp): add exclude-interfaces option to skip controller generation#11495
abatishchev with Copilot wants to merge 3 commits into
mainfrom
copilot/featurehttp-server-csharp-disable-operations-contr

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

RPaaS and similar hosting platforms handle certain endpoints (e.g., ARM Operations) automatically, making the generated controller and business-logic interface files unnecessary noise.

Changes

  • New emitter option exclude-interfaces (string[]) in lib.ts — lists TypeSpec interface names to skip during generation
  • emitter.tsx — filters resolved interfaces against the exclusion set before passing to ControllersAndInterfaces, MockImplementations, and mock registration helpers; excluded interfaces produce no *Controller.cs or I*.cs files
  • Teststest/exclude-interfaces.test.ts covers single exclusion, multi-exclusion, no-op exclusion, and baseline (no exclusions)
  • Changelogfeature entry for @typespec/http-server-csharp

Usage

# tspconfig.yaml
options:
  "@typespec/http-server-csharp":
    exclude-interfaces:
      - Operations

With the above config, OperationsController.cs and IOperations.cs are not emitted; all other interfaces are unaffected.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: abatishchev <351644+abatishchev@users.noreply.github.com>
Copilot AI changed the title [WIP] Add configuration to disable generating Operations controller feat(http-server-csharp): add exclude-interfaces option to skip controller generation Jul 30, 2026
Copilot AI requested a review from abatishchev July 30, 2026 18:17
- "@typespec/http-server-csharp"
---

Add `exclude-interfaces` emitter option to skip controller and business-logic interface generation for specified TypeSpec interfaces.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot why it's exclude-interfaces The issue is about Operations controller. Hence the key should be called include-operations-controller of type boolean: include if true, otherwise don't. Default it to false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replaced exclude-interfaces with include-operations-controller: boolean (default false). When false (default), the controller and interface for any TypeSpec interface named exactly Operations are not generated. Set to true to include them.

Committed in the latest push.

…rations-controller boolean option

Co-authored-by: abatishchev <351644+abatishchev@users.noreply.github.com>
Copilot AI requested a review from abatishchev July 30, 2026 18:53
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.

[Feature request] http-server-csharp: Configuration key to turn of generating Operations controller

2 participants