From e294bb01973d61582f04ed858498b52eade18bbf Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 13 Jul 2021 16:18:19 -0400 Subject: [PATCH] remove all hosts from global parameters (#972) --- ChangeLog.md | 10 ++++++++++ autorest/codegen/__init__.py | 6 +++--- package.json | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index c019327161a..59741b87989 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,15 @@ # Change Log +### 2021-07-06 - 5.8.4 + +min Autorest core version: 3.3.0 + +min Modelerfour version: 4.19.1 + +**Bug Fixes** + +- Remove all hosts from global parameters, regardless of how many m4 sends us #972 + ### 2021-07-06 - 5.8.3 min Autorest core version: 3.3.0 diff --git a/autorest/codegen/__init__.py b/autorest/codegen/__init__.py index defd861456f..eb9bfed957c 100644 --- a/autorest/codegen/__init__.py +++ b/autorest/codegen/__init__.py @@ -84,9 +84,9 @@ def _create_code_model(self, yaml_data: Dict[str, Any], options: Dict[str, Union first_req_of_first_op_of_first_grp = yaml_data["operationGroups"][0]["operations"][0]["requests"][0] code_model.custom_base_url = first_req_of_first_op_of_first_grp["protocol"]["http"]["uri"] else: - dollar_host_parameter = dollar_host[0] - code_model.global_parameters.remove(dollar_host_parameter) - code_model.base_url = dollar_host_parameter.yaml_data["clientDefaultValue"] + for host in dollar_host: + code_model.global_parameters.remove(host) + code_model.base_url = dollar_host[0].yaml_data["clientDefaultValue"] # Create operations if yaml_data.get("operationGroups"): diff --git a/package.json b/package.json index 10632deeddb..e6da4331f7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/python", - "version": "5.8.3", + "version": "5.8.4", "description": "The Python extension for generators in AutoRest.", "scripts": { "prepare": "node run-python3.js prepare.py",