feat(http-server-csharp): add exclude-interfaces option to skip controller generation - #11495
Draft
abatishchev with Copilot wants to merge 3 commits into
Draft
feat(http-server-csharp): add exclude-interfaces option to skip controller generation#11495abatishchev with Copilot wants to merge 3 commits into
exclude-interfaces option to skip controller generation#11495abatishchev with Copilot wants to merge 3 commits into
Conversation
|
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. |
3 tasks
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 Jul 30, 2026
exclude-interfaces option to skip controller generation
abatishchev
requested changes
Jul 30, 2026
| - "@typespec/http-server-csharp" | ||
| --- | ||
|
|
||
| Add `exclude-interfaces` emitter option to skip controller and business-logic interface generation for specified TypeSpec interfaces. |
Member
There was a problem hiding this comment.
@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
Contributor
Author
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
exclude-interfaces(string[]) inlib.ts— lists TypeSpec interface names to skip during generationemitter.tsx— filters resolved interfaces against the exclusion set before passing toControllersAndInterfaces,MockImplementations, and mock registration helpers; excluded interfaces produce no*Controller.csorI*.csfilestest/exclude-interfaces.test.tscovers single exclusion, multi-exclusion, no-op exclusion, and baseline (no exclusions)featureentry for@typespec/http-server-csharpUsage
With the above config,
OperationsController.csandIOperations.csare not emitted; all other interfaces are unaffected.