Simplify StreamSerializationModelTemplate#2928
Simplify StreamSerializationModelTemplate#2928weidongxu-microsoft merged 4 commits intoAzure:mainfrom
Conversation
|
test https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4067144&view=results
|
vanilla-tests/src/main/java/fixtures/bodycomplex/models/Goblinshark.java
Show resolved
Hide resolved
|
Hi @alzimmermsft, I merged your pr with main branch to a feature branch, and tried to regenerate for TypeSpec SDKs based on the branch. I found API view diff like below, PR: Azure/azure-sdk-for-java#41617 Thanks. |

Cleans up a lot of code in
StreamSerializationModelTemplateby using an instance class to generate code. This removes the need to pass many parameters all over the place.There is also a fix to generating fields in
ModelTemplateby having the overload ofgetFieldPropertiescheck iffromJsonSharedcan be used to determine whether the subclass should shade fields of a super class. The only time shading shouldn't happen with polymorphic types is whenfromJsonSharedcan be used as those properties will be deserialized by the super type'sfromJsonSharedmethod, meaning the subtype doesn't need to shade.