k-paxian / dart-json-mapper

Serialize / Deserialize Dart Objects to / from JSON
https://pub.dev/packages/dart_json_mapper
Other
399 stars 33 forks source link

Improve class instance creation error handling #211

Closed k-paxian closed 1 year ago

k-paxian commented 1 year ago

When this model is instantiated

@jsonSerializable
class Person {
  final String name;
  final int age;
  const Person(this.name, this.age);
}

with the following json

{
   "name": "Bob"
}

console error feedback is flutter: type 'Null' is not a subtype of type 'String' which is not informative enough

based on feedback from this issue

k-paxian commented 1 year ago

@rgjurgens From version 2.2.8 instance creation error should be more informative when some arguments are empty. When you have a chance to check it out, please let me know if it's better now

rgjurgens commented 1 year ago

Cool!!!! I haven't checked it yet. I'm running into issues on this depency: intl: ^0.17.0 I think your lib wants to use intl: ^0.18.0 but then other packages are complaining they don't work with that 0.18 version? Does that sound familiar?

k-paxian commented 1 year ago

Well, there's two ways to solve,

rgjurgens commented 1 year ago

Ok, cool. Let me override the dependency then!