Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/http-client-python"
---

Add imports for readonly and constant props for msrest model generation
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ def imports(self) -> FileImport:
called_by_property=True,
)
)
for prop in model.properties:
if prop.readonly:
# it will be defined in the __init__ so we need to import it
file_import.merge(
prop.imports(
serialize_namespace=self.serialize_namespace,
serialize_namespace_type=NamespaceType.MODEL,
called_by_property=True,
)
)

return file_import

Expand Down
Loading