Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce useRestProxy Flag to Enable RestProxy Functionality #43753

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samvaity
Copy link
Member

@samvaity samvaity commented Jan 9, 2025

Description

This PR introduces a useRestProxy flag to toggle the use of RestProxy.create functionality. This flag ensures that when compile-time code generation is used (i.e., useRestProxy is set to false), we do not inadvertently use the RestProxy code path.

Does this capture what you intended?

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

final SwaggerInterfaceParser interfaceParser = SwaggerInterfaceParser.getInstance(swaggerInterface);
final RestProxy restProxy
= new RestProxy(httpPipeline, interfaceParser, new JsonSerializer(), new XmlSerializer());
public static <A> A create(Class<A> swaggerInterface, HttpPipeline httpPipeline, boolean useRestProxy) {
Copy link
Member Author

@samvaity samvaity Jan 10, 2025

Choose a reason for hiding this comment

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

@srnagar I added it to the public API so that we can have the ServiceClientImpl generation to on/off the flag but that would make it a part of generation utility too, Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant