-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Adding toJson methods to DTOs #372
Comments
Hi @hasimyerlikaya, We were looking into implementing |
Yes, we’ve implemented this for all entities that can be parsed from native bridges, but not for everything. The toJson methods have only been added for those that are transferred to native bridges. If we decide to make both methods publicly available, we’ll include them for all entities. However, I foresee some challenges with this approach regarding changes. Currently, we can modify the keys and content as needed. Making these methods public would mean that any such changes would have to be reserved for major releases. Anyway, I’ll talk it over with my colleagues first. |
Honestly, I don’t think making changes to all models would be a well-received request. At least for now, it would be sufficient to update only the models that already have a fromJson method. These are the models we are likely to want to store and debug. I’m not sure if we need these methods for all models. Of course, the team will make the most appropriate decision. |
Hi,
I saw that
toJson
methods are disabled for DTOs.I don't know why you decided this, but it would be better if you added toJson methods too.
I was debugging with breakpoints, and at one point I decided to print the entitlement response to the console to do better and faster debugging. I realize that there is no toJson method for entitlement.dart.
In some cases we might need to store the conversion responses to our databases. ToJson methods would be helpful for that too.
Can I add toJson methods to DTOs?
The text was updated successfully, but these errors were encountered: