-
Notifications
You must be signed in to change notification settings - Fork 61
Revert client signature endpoint to base_url to avoid breaking for Mgmt SDK
#2758
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| changeKind: fix | ||
| packages: | ||
| - "@azure-tools/typespec-python" | ||
| --- | ||
|
|
||
| Revert client signature `endpoint` to `base_url` to avoid breaking for Mgmt SDK |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,8 +34,8 @@ class ManagedIdentityClient: # pylint: disable=client-accepts-api-version-keywo | |
| :type credential: ~azure.core.credentials.TokenCredential | ||
| :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. | ||
| :type subscription_id: str | ||
| :keyword endpoint: Service host. Default value is "https://management.azure.com". | ||
| :paramtype endpoint: str | ||
| :param base_url: Service host. Default value is "https://management.azure.com". | ||
| :type base_url: str | ||
| :keyword api_version: The API version to use for this operation. Default value is | ||
| "2023-12-01-preview". Note that overriding this default value may result in unsupported | ||
| behavior. | ||
|
|
@@ -46,13 +46,12 @@ def __init__( | |
| self, | ||
| credential: "TokenCredential", | ||
| subscription_id: str, | ||
| *, | ||
| endpoint: str = "https://management.azure.com", | ||
| base_url: str = "https://management.azure.com", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revert client signature endpoint to base_url to avoid breaking for Mgmt SDK (example of real case: https://github.com/Azure/azure-sdk-for-python/blob/131e9ab94a8dec847426337001605001d7e1f0cb/sdk/apicenter/azure-mgmt-apicenter/azure/mgmt/apicenter/_api_center_mgmt_client.py#L69-L74) |
||
| **kwargs: Any | ||
| ) -> None: | ||
| _endpoint = "{endpoint}" | ||
| self._config = ManagedIdentityClientConfiguration( | ||
| credential=credential, subscription_id=subscription_id, endpoint=endpoint, **kwargs | ||
| credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs | ||
| ) | ||
| _policies = kwargs.pop("policies", None) | ||
| if _policies is None: | ||
|
|
@@ -101,7 +100,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: | |
|
|
||
| request_copy = deepcopy(request) | ||
| path_format_arguments = { | ||
| "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), | ||
| "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), | ||
| } | ||
|
|
||
| request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emitter-options shall be posix path style otherwise cause warning: microsoft/typespec#4023