Fix remove-model in TypeSpec Java management generation - #11698
Merged
Weidong Xu (weidongxu-microsoft) merged 2 commits intoAug 17, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 896b64bc-5bf6-4cb3-8b84-089eb78e20c7
Contributor
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
Weidong Xu (weidongxu-microsoft)
marked this pull request as ready for review
August 17, 2026 06:14
Weidong Xu (weidongxu-microsoft)
requested a review
from Haoling Dong (haolingdong-msft)
as a code owner
August 17, 2026 06:14
Weidong Xu (weidongxu-microsoft)
requested review from
Xiaofei Cao (XiaofeiCao),
Alan Zimmer (alzimmermsft) and
Jesse Squire (jsquire)
as code owners
August 17, 2026 06:14
Copilot started reviewing on behalf of
Weidong Xu (weidongxu-microsoft)
August 17, 2026 06:15
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes how the remove-model option is applied during TypeSpec Java management (Fluent) generation by ensuring the active (factory-selected) model mapper receives the removed-model set, and by preventing configured enum models from being emitted.
Changes:
- Route
remove-modelinto the factory-selectedModelMapperused by Fluent management generation (instead of always using the singleton instance). - Skip emitting enum types whose names are configured in
remove-model. - Add a regression test to ensure
remove-modelis applied to the configured model mapper implementation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/http-client-java/generator/http-client-generator-mgmt/src/test/java/com/microsoft/typespec/http/client/generator/mgmt/mapper/FluentMapperTests.java | Adds regression coverage ensuring remove-model is applied to the factory-selected model mapper. |
| packages/http-client-java/generator/http-client-generator-mgmt/src/main/java/com/microsoft/typespec/http/client/generator/mgmt/mapper/FluentMapper.java | Applies removed models to the active (factory-selected) Fluent model mapper. |
| packages/http-client-java/generator/http-client-generator-mgmt/src/main/java/com/microsoft/typespec/http/client/generator/mgmt/FluentGen.java | Omits configured enum models from template emission. |
| .chronus/changes/http-client-java-remove-model-generation-2026-08-17.md | Adds changelog entry for the remove-model fix in management generation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…/src/test/java/com/microsoft/typespec/http/client/generator/mgmt/mapper/FluentMapperTests.java
Weidong Xu (weidongxu-microsoft)
enabled auto-merge
August 17, 2026 06:21
Copilot started reviewing on behalf of
Weidong Xu (weidongxu-microsoft)
August 17, 2026 06:21
View session
Xiaofei Cao (XiaofeiCao)
approved these changes
Aug 17, 2026
Weidong Xu (weidongxu-microsoft)
deleted the
fix/http-client-java-remove-model
branch
August 17, 2026 07:48
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.
Summary
remove-modelto the active TypeSpec Fluent model mapperFollow-up to #11658.
Validation
npm run buildnpm run formatFluentMapperTestsazure-rest-api-specscommit8199a40d; all 11 configured models and enums were absent