Closed claytonlemons closed 3 years ago
It looks like this might be an issue with fastjsonschema. I can't reproduce this when using jsonschema instead. Maybe worth raising an issue there.
Otherwise, you can just copy my_dict
to avoid this problem.
When calling
from_dict
on a class derived from JsonSchemaMixin, the dict argument may be modified if it does not contain a value for a field in the class and that class field has a default value. For example:The name
from_dict
suggests that data is only read from the dict argument, so it seems reasonable that thefrom_dict
implementation should make a copy of the dict first before updating missing fields with default values.