-
Notifications
You must be signed in to change notification settings - Fork 321
Open
Open
Copy link
Labels
emitter:client:pythonIssue for the Python client emitter: @typespec/http-client-pythonIssue for the Python client emitter: @typespec/http-client-python
Description
Python SDK models support three operations: initialization, getting attributes, and setting attributes. The Python team implemented compatibility mechanisms to preserve attribute getter/setter behavior.
# Before TypeSpec migration
model = Key(kty=...)
model.kty = "..." # Set attribute
print(model.kty) # Get attribute
# After TypeSpec migration - Initialization (Breaking Change)
model = Key(kty=...) # ❌ No longer supported
model = Key(properties=KeyProperties(kty=...)) # ✅ New required structure
# After TypeSpec migration - Attribute access (Backward Compatible)
model.kty = "..." # ✅ Still works
print(model.kty) # ✅ Still works
# After TypeSpec migration - Recommended approach
model.properties.kty = "..." # ✅ Recommended
print(model.properties.kty) # ✅ Recommended
Metadata
Metadata
Assignees
Labels
emitter:client:pythonIssue for the Python client emitter: @typespec/http-client-pythonIssue for the Python client emitter: @typespec/http-client-python