Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17aac0b552 | |||
| c281a329a4 | |||
| ca472716db |
@@ -252,6 +252,9 @@ class Base(_RegisteringBase):
|
|||||||
if t is None:
|
if t is None:
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
if value is None:
|
||||||
|
return None
|
||||||
|
|
||||||
if t.__module__ == "typing":
|
if t.__module__ == "typing":
|
||||||
origin = getattr(t, "__origin__")
|
origin = getattr(t, "__origin__")
|
||||||
t = (
|
t = (
|
||||||
|
|||||||
@@ -60,14 +60,19 @@ class BaseObjectSerializer:
|
|||||||
chunkable = False
|
chunkable = False
|
||||||
detach = False
|
detach = False
|
||||||
|
|
||||||
# skip nulls or props marked to be ignored with "__" or "_"
|
# skip props marked to be ignored with "__" or "_"
|
||||||
if value is None or prop.startswith(("__", "_")):
|
if prop.startswith(("__", "_")):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# don't prepopulate id as this will mess up hashing
|
# don't prepopulate id as this will mess up hashing
|
||||||
if prop == "id":
|
if prop == "id":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# allow serialisation of nulls
|
||||||
|
if value is None:
|
||||||
|
object_builder[prop] = value
|
||||||
|
continue
|
||||||
|
|
||||||
# only bother with chunking and detaching if there is a write transport
|
# only bother with chunking and detaching if there is a write transport
|
||||||
if self.write_transports:
|
if self.write_transports:
|
||||||
dynamic_chunk_match = prop.startswith("@") and re.match(
|
dynamic_chunk_match = prop.startswith("@") and re.match(
|
||||||
|
|||||||
Reference in New Issue
Block a user