You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a lot of hardcoded values used for object mapping for models (from_dict method) within the library. For instance, this is the Section class mapping from dict:
I suggest allowing some third-party object mapping library like pydantic or msgspec to handle this logic.
The problem it solves
The current implementation with hardcoded values in the from_dict method makes the code less maintainable and flexible. By integrating a third-party library for object mapping, we can improve readability, maintainability, and reduce the chances of errors.
Alternatives
Currently, we could continue with the hardcoded approach, but it may lead to increased complexity and maintenance overhead as the project grows. Alternatively, we can manually implement more flexible object mapping methods, but this may also introduce additional boilerplate code and potential errors.
Use case / screenshots
N/A
Additional information
Integrating a third-party library for object mapping will not only streamline the codebase but also potentially introduce additional features such as validation and serialization, which can enhance the robustness and usability of the library.
The text was updated successfully, but these errors were encountered:
Enhancement description
There are a lot of hardcoded values used for object mapping for models (
from_dict
method) within the library. For instance, this is theSection
class mapping from dict:I suggest allowing some third-party object mapping library like pydantic or msgspec to handle this logic.
The problem it solves
The current implementation with hardcoded values in the
from_dict
method makes the code less maintainable and flexible. By integrating a third-party library for object mapping, we can improve readability, maintainability, and reduce the chances of errors.Alternatives
Currently, we could continue with the hardcoded approach, but it may lead to increased complexity and maintenance overhead as the project grows. Alternatively, we can manually implement more flexible object mapping methods, but this may also introduce additional boilerplate code and potential errors.
Use case / screenshots
N/A
Additional information
Integrating a third-party library for object mapping will not only streamline the codebase but also potentially introduce additional features such as validation and serialization, which can enhance the robustness and usability of the library.
The text was updated successfully, but these errors were encountered: