diff --git a/.chronus/changes/fix-namespace-new-2025-0-24-16-11-9.md b/.chronus/changes/fix-namespace-new-2025-0-24-16-11-9.md new file mode 100644 index 00000000000..35ffdd6fc95 --- /dev/null +++ b/.chronus/changes/fix-namespace-new-2025-0-24-16-11-9.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-client-python" +--- + +Fix output folder of models when output folder is different with namespace in configuration \ No newline at end of file diff --git a/packages/http-client-python/CHANGELOG.md b/packages/http-client-python/CHANGELOG.md index 7cf88bbc625..aeba9a78b97 100644 --- a/packages/http-client-python/CHANGELOG.md +++ b/packages/http-client-python/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log - @typespec/http-client-python +## 0.6.9 + +### Bug Fixes + +- Fix output folder of models when output folder is different with namespace in configuration + ## 0.6.8 ### Bug Fixes diff --git a/packages/http-client-python/generator/pygen/codegen/serializers/__init__.py b/packages/http-client-python/generator/pygen/codegen/serializers/__init__.py index 99fa85c430c..25531abe3cf 100644 --- a/packages/http-client-python/generator/pygen/codegen/serializers/__init__.py +++ b/packages/http-client-python/generator/pygen/codegen/serializers/__init__.py @@ -238,7 +238,7 @@ def _serialize_and_write_models_folder( self, env: Environment, namespace: str, models: List[ModelType], enums: List[EnumType] ) -> None: # Write the models folder - models_path = self.exec_path(namespace + ".models") + models_path = self.exec_path(namespace) / "models" serializer = DpgModelSerializer if self.code_model.options["models_mode"] == "dpg" else MsrestModelSerializer if self.code_model.has_non_json_models(models): self.write_file( diff --git a/packages/http-client-python/package-lock.json b/packages/http-client-python/package-lock.json index 607f8c8ca68..35743726c64 100644 --- a/packages/http-client-python/package-lock.json +++ b/packages/http-client-python/package-lock.json @@ -1,12 +1,12 @@ { "name": "@typespec/http-client-python", - "version": "0.6.8", + "version": "0.6.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-python", - "version": "0.6.8", + "version": "0.6.9", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index cc8061eba53..c7904e948a4 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-python", - "version": "0.6.8", + "version": "0.6.9", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://typespec.io",