google / json_serializable.dart

Generates utilities to aid in serializing to/from JSON.
https://pub.dev/packages/json_serializable
BSD 3-Clause "New" or "Revised" License
1.55k stars 397 forks source link

Try to remove non-nullable converter if duplicate found for nullable targetType #1343

Open julek-kal opened 1 year ago

julek-kal commented 1 year ago

Connection with issue(s)

Close #1339

Solution description

When targetType is nullable and the class is annotated with both converters for nullable and non-nullable type, _compatibleMatch returns two of them. So I've added a check if targetType is nullable and matchingAnnotations length is equal to 2, if so I proceed to try to find a non-null converter and remove it from the list of matchedConverters.

To Do

google-cla[bot] commented 1 year ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.