You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While regenerating an SDK to use stream-style serialization I found that the JsonMergePatchHelper pattern used to turn on and off patch serialization doesn't work correctly for polymorphic types.
When the models support JSON merge patch each model will create an access helper and add a boolean flag to determine whether JSON merge patch serialization should be used when calling toJson. This isn't necessary and can be a single instance on the super type by having the super type expose the patch serialization status to child types. So instead of:
While regenerating an SDK to use stream-style serialization I found that the
JsonMergePatchHelperpattern used to turn on and off patch serialization doesn't work correctly for polymorphic types.When the models support JSON merge patch each model will create an access helper and add a boolean flag to determine whether JSON merge patch serialization should be used when calling
toJson. This isn't necessary and can be a single instance on the super type by having the super type expose the patch serialization status to child types. So instead of:it can be simplified to
And since there is boilerplate code for each accessor this will simplify that to one instance per polymorphic model hierarchy.
Further investigation could be done to see if it is possible for all models within a single package could use the same access helper.