Closed martinralfreindl closed 7 months ago
I also think this feature would be really helpful.
Already have it. Look at the "checked" property - https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonSerializable/checked.html
On Fri, Dec 8, 2023 at 1:49 AM Swayambhoo-Manu @.***> wrote:
I also think this feature would be really helpful.
— Reply to this email directly, view it on GitHub https://github.com/google/json_serializable.dart/issues/1381#issuecomment-1846875171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCRVPIBVAUMJS65C2BTYILPCDAVCNFSM6AAAAABAML2UCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBWHA3TKMJXGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Amazing. Thank you so much. Worked like a charm!
Suppose I have a large and very nested json that represents a user. The json has tons of attributes (over 200 of them), but deeply nested in that json under user->settings->general there is a field called
age
, where the user's age is defined as an integer. If my backend somehow forgets to fill in this age field, json_serializable will now throw an error along the lines of:It's nice that I get the error, but now I have to go find which of those 200 fields the error is from, and that takes forever. Would it be possible to improve json_serializable error message along the lines of:
This would make it way easier for us to detect errors in large files