Azure / autorest.python

Extension for AutoRest (https://github.com/Azure/autorest) that generates Python code
MIT License
80 stars 57 forks source link

[typespec-python] Bug in generating renamed models #2789

Open YalinLi0312 opened 2 months ago

YalinLi0312 commented 2 months ago

Renamed models themselves are generated correctly, but not get propagated to all of the usages like in operations and models. For example, in AppConfig, we renamed the model "Error" to "AppConfigError" in tsp. While in generated code, it's still using the old name as return type in some operations, like in begin_create_snapshot() (note: the return type of this method does not generate correctly, should be LRO[_models.Snapshot]) Also in models, like in model OperationDetails.

Expected: Should generate with the new name on the renamed models in all usages in the package.

msyyc commented 2 months ago

@YalinLi0312

msyyc commented 1 month ago

@YalinLi0312 About return type of begin_create_snapshot is wrong which causes by bug of typespec-azure-core and I have created issue https://github.com/Azure/typespec-azure/issues/1407 to track it., according to https://github.com/Azure/typespec-azure/issues/1407#issuecomment-2339425126, the typespec author shall update the typespec definition.