@autorest/python 6.8.1 → 6.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1126,10 +1126,7 @@ class M4Reformatter(
1126
1126
  "skipUrlEncoding": True,
1127
1127
  "inOverload": False,
1128
1128
  }
1129
- if self.version_tolerant:
1130
- parameters.append(credential)
1131
- else:
1132
- parameters.insert(0, credential)
1129
+ parameters.append(credential)
1133
1130
 
1134
1131
  def update_client(self, yaml_data: Dict[str, Any]) -> Dict[str, Any]:
1135
1132
  parameters = self.update_global_parameters(
@@ -281,7 +281,8 @@ class PreProcessPlugin(YamlUpdatePlugin): # pylint: disable=abstract-method
281
281
  yaml_data["description"], default_description=yaml_data["name"]
282
282
  )
283
283
  yaml_data["legacyFilename"] = to_snake_case(yaml_data["name"].replace(" ", "_"))
284
- for parameter in yaml_data["parameters"]:
284
+ parameters = yaml_data["parameters"]
285
+ for parameter in parameters:
285
286
  self.update_parameter(parameter)
286
287
  if parameter["clientName"] == "credential":
287
288
  policy = parameter["type"].get("policy")
@@ -294,7 +295,13 @@ class PreProcessPlugin(YamlUpdatePlugin): # pylint: disable=abstract-method
294
295
  policy["credentialScopes"] = [
295
296
  "https://management.azure.com/.default"
296
297
  ]
297
-
298
+ if (
299
+ (not self.version_tolerant or self.azure_arm)
300
+ and parameters
301
+ and parameters[-1]["clientName"] == "credential"
302
+ ):
303
+ # we need to move credential to the front in mgmt mode for backcompat reasons
304
+ yaml_data["parameters"] = [parameters[-1]] + parameters[:-1]
298
305
  prop_name = yaml_data["name"]
299
306
  if prop_name.endswith("Client"):
300
307
  prop_name = prop_name[: len(prop_name) - len("Client")]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "6.8.1",
3
+ "version": "6.9.0",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "main": "index.js",
6
6
  "repository": {