@azure/core-client 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -884,11 +884,17 @@ function deserializeCompositeType(serializer, mapper, responseBody, objectName,
884
884
  let propertyInstance;
885
885
  let res = responseBody;
886
886
  // traversing the object step by step.
887
+ let steps = 0;
887
888
  for (const item of paths) {
888
889
  if (!res)
889
890
  break;
891
+ steps++;
890
892
  res = res[item];
891
893
  }
894
+ // only accept null when reaching the last position of object otherwise it would be undefined
895
+ if (res === null && steps < paths.length) {
896
+ res = undefined;
897
+ }
892
898
  propertyInstance = res;
893
899
  const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator;
894
900
  // checking that the model property name (key)(ex: "fishtype") and the