Add max-overload mode to generate protocol/model WithResponse overloads for Java data-plane clients#10744
Draft
Copilot wants to merge 3 commits into
Draft
Add max-overload mode to generate protocol/model WithResponse overloads for Java data-plane clients#10744Copilot wants to merge 3 commits into
max-overload mode to generate protocol/model WithResponse overloads for Java data-plane clients#10744Copilot wants to merge 3 commits into
Conversation
3 tasks
…hods Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/aee86c1c-fc77-4e89-93e8-a148c5d49443 Co-authored-by: srnagar <51379715+srnagar@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/aee86c1c-fc77-4e89-93e8-a148c5d49443 Co-authored-by: srnagar <51379715+srnagar@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add option to generate max overloads with models
Add May 20, 2026
max-overload mode to generate protocol/model WithResponse overloads for Java data-plane clients
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.
This change adds explicit control over max
WithResponseoverload generation in the Java emitter/generator. It supports generating protocol (BinaryData), model, or both overload sets, while preserving Java overload legality by falling back to protocol when signatures differ only by return type.Config surface
@typespec/http-client-java.max-overloademitter option with values:protocol(default)modelallGenerator settings + mode plumbing
MaxOverloadenum and parsing inJavaSettings.isGenerateProtocolMaxOverload,isGenerateModelMaxOverload) for mapper/template logic.WithResponseoverload generation behaviorWithResponsemapping for data-plane clients:protocol: generate protocol-style max overloads only.model: generate model max overloads (usingRequestOptions) and suppress public protocol overload exposure where model API exists.all: generate both, except when Java signature collision would occur.Collision handling for
allWithResponseoverloads normalize to the same public signature (name + params), model overload is dropped.Convenience template alignment
RequestOptionsparameterized model max overloads (null-safe initialization when passed in vs local creation).Focused test coverage updates
protocol/model/allvisibility behavior.JavaSettingsmodes deterministically.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
archive.eclipse.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/typespec/typespec/packages/http-client-java/generator org.codehaus.plexus.classworlds.launcher.Launcher -pl http-client-generator-core spotless:apply(dns block)If you need me to access, download, or install something from one of these locations, you can either: