Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move
should_use_default
check into process_kwargs
By moving the check into `process_kwargs`, we can just safely avoid any edge cases that may arise from how the defaults are defined. If we should be using the default for a field, we can just not add it to the kwargs that we finally end up passing to the constructor of the model. This way, we ensure that the creation of the default value will happen normally however the underlying library (dataclasses, pydantic etc.) would handle it.
- Loading branch information