Skip to content

Commit

Permalink
Fix multipart import (#2729)
Browse files Browse the repository at this point in the history
* fix import for multipart

* changelog
  • Loading branch information
msyyc authored Jul 30, 2024
1 parent df8fef5 commit fbe8a5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .chronus/changes/fix-multipart-import-2024-6-29-16-22-46.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@azure-tools/typespec-python"
---

Fix import for multipart
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,9 @@ def imports(self, async_mode: bool, **kwargs: Any) -> FileImport:
relative_path = "..." if async_mode else ".."
if self.code_model.options["models_mode"] == "dpg":
if self.parameters.has_body:
if not self.has_form_data_body:
if self.has_form_data_body:
file_import.add_submodule_import(relative_path, "_model_base", ImportType.LOCAL)
else:
file_import.add_submodule_import(
f"{relative_path}_model_base",
"SdkJSONEncoder",
Expand Down

0 comments on commit fbe8a5a

Please sign in to comment.