-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy attributes back post de-serializing array #451
Copy attributes back post de-serializing array #451
Conversation
lib/serializer.ts
Outdated
const arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName); | ||
// Copy over any properties that have already been added into the instance, where they do | ||
// not exist on the newly de-serialized array | ||
Object.entries(instance).forEach(([key, value]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
Object.entries(instance).forEach(([key, value]) => { | |
for (const [key, value] of Object.entries(instance)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated
@jeremymeng, @xirzec Do we have a similar issue in |
I am looking into it. |
Porting fix from Azure/ms-rest-js#451. When flattening array, we were assigning directly to the result instance, thus losing any properties that were deserialized previously in the loop. The fix is to copy the existing properties over. Fixes Azure#15653.
@deyaaeldeen @xirzec are you good with the fix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…ion (#15655) Porting fix from Azure/ms-rest-js#451. When flattening array, we were assigning directly to the result instance, thus losing any properties that were deserialized previously in the loop. The fix is to copy the existing properties over. Fixes #15653.
…ion (Azure#15655) Porting fix from Azure/ms-rest-js#451. When flattening array, we were assigning directly to the result instance, thus losing any properties that were deserialized previously in the loop. The fix is to copy the existing properties over. Fixes Azure#15653.
Fixes #450