Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dataclasses_json/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def schema(cls: Type[A],
return Schema(only=only,
exclude=exclude,
many=many,
context=context,
load_only=load_only,
dump_only=dump_only,
partial=partial,
Expand Down
10 changes: 6 additions & 4 deletions dataclasses_json/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ def inner(type_, options):

if is_dataclass(type_):
if _issubclass_safe(type_, mixin):
options['field_many'] = bool(
_is_supported_generic(field.type) and _is_collection(
field.type))
options['metadata'] = {
"field_many": bool(
_is_supported_generic(field.type) and _is_collection(
field.type))
}
return fields.Nested(type_.schema(), **options)
else:
warnings.warn(f"Nested dataclass field {field.name} of type "
Expand Down Expand Up @@ -305,7 +307,7 @@ def schema(cls, mixin, infer_missing):
else:
type_ = field.type
options: typing.Dict[str, typing.Any] = {}
missing_key = 'missing' if infer_missing else 'default'
missing_key = 'load_default' if infer_missing else 'dump_default'
if field.default is not MISSING:
options[missing_key] = field.default
elif field.default_factory is not MISSING:
Expand Down
Loading
Loading