Skip to content

Commit fe9b944

Browse files
committed
Allow intermediate node to be None while fallowing flattening
1 parent 32ae993 commit fe9b944

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

msrest/serialization.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,11 @@ def rest_key_extractor(attr, attr_desc, data):
11081108
break
11091109
working_key = _decode_attribute_map_key(dict_keys[0])
11101110
working_data = working_data.get(working_key, data)
1111+
if working_data is None:
1112+
# If at any point while following flatten JSON path see None, it means
1113+
# that all properties under are None as well
1114+
# https://github.com/Azure/msrest-for-python/issues/197
1115+
return None
11111116
key = '.'.join(dict_keys[1:])
11121117

11131118
return working_data.get(key)

0 commit comments

Comments
 (0)