Azure / autorest.java

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

arm, remove special handling for ARM types #2749

Closed XiaofeiCao closed 1 month ago

XiaofeiCao commented 1 month ago

typespec-azure-resource-manager has fixed the naming issue: https://github.com/Azure/typespec-azure/pull/762 Our special handling for Resource, ProxyResource and ArmResource is no longer needed.

weidongxu-microsoft commented 1 month ago

ArmResource is deprecated but not removed. Do we still need this till it get removed?

XiaofeiCao commented 1 month ago

ArmResource is deprecated but not removed. Do we still need this till it get removed?

I searched current specs repo, seems (Arm)Resource is only used in template parameters as : https://github.com/search?q=repo%3AAzure%2Fazure-rest-api-specs+%22ArmResource%22&type=code&p=1 I added back one ArmResource in our test, seems ok.

(Arm)Resource is used as base model for all Tracked/Proxy/ExtensionResource(Base). I guess service is not allowed to let its models directly extend ArmResource, otherwise it'll break JS and Python..

XiaofeiCao commented 1 month ago

Offline sync with Chenjie, service will not use ArmResource for green field. For brownfields, there exists cases where model directly extends Resource, and will be converted to Resource in tsp, still no ArmResource. And existing ArmResource will be fixed to Resource.