@autorest/python 6.1.9 → 6.1.10
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.
|
@@ -386,7 +386,7 @@ def update_response(
|
|
|
386
386
|
def _get_default_content_type( # pylint: disable=too-many-return-statements
|
|
387
387
|
content_types: Iterable[str],
|
|
388
388
|
) -> Optional[str]:
|
|
389
|
-
json_values = [ct for ct in content_types if JSON_REGEXP.match(ct)]
|
|
389
|
+
json_values = [ct for ct in content_types if JSON_REGEXP.match(ct.split(";")[0])]
|
|
390
390
|
if json_values:
|
|
391
391
|
if "application/json" in json_values:
|
|
392
392
|
return "application/json"
|
|
@@ -131,11 +131,13 @@ class PostProcessPlugin(Plugin): # pylint: disable=abstract-method
|
|
|
131
131
|
f for f in folders if f.stem in ["operations", "_operations"]
|
|
132
132
|
]
|
|
133
133
|
for operations_folder in operations_folders:
|
|
134
|
-
|
|
134
|
+
sub_namespace = ".".join(
|
|
135
|
+
str(operations_folder.relative_to(self.base_folder)).split(os.sep)
|
|
136
|
+
)
|
|
135
137
|
self.fix_imports_in_init(
|
|
136
138
|
generated_file_name="_operations",
|
|
137
139
|
folder_path=operations_folder,
|
|
138
|
-
namespace=f"{self.namespace}
|
|
140
|
+
namespace=f"{self.namespace}.{sub_namespace}",
|
|
139
141
|
)
|
|
140
142
|
shutil.rmtree(f"{str(self.output_folder)}/.temp_folder")
|
|
141
143
|
return True
|
|
@@ -155,7 +157,7 @@ class PostProcessPlugin(Plugin): # pylint: disable=abstract-method
|
|
|
155
157
|
k: None for k in customized_objects_str.split(",")
|
|
156
158
|
}.keys() # filter out duplicates
|
|
157
159
|
file = (folder_path / "__init__.py").relative_to(self.output_folder)
|
|
158
|
-
file_content = self.read_file(file)
|
|
160
|
+
file_content = self.read_file(file).replace("\r\n", "\n")
|
|
159
161
|
added_objs = []
|
|
160
162
|
for obj in customized_objects:
|
|
161
163
|
if f" import {obj}\n" in file_content:
|