json_serializable.dart icon indicating copy to clipboard operation
json_serializable.dart copied to clipboard

Generates utilities to aid in serializing to/from JSON.

Results 161 json_serializable.dart issues
Sort by recently updated
recently updated
newest added

i am unable to generate my model file after upgrading my flutter and dart sdk `dart --version` Dart SDK version: 3.5.0-103.0.dev (dev) (Thu Apr 25 17:03:06 2024 -0700) on "macos_x64"...

I want to make code much shorter without use JsonConverter. While factory fromJson cannot return null I need to use static fromJson instead. But, g.dart file didn't provide what i...

Due to the need to display local time in the application Want to add an option in the configuration file to allow users to choose whether to use local time...

Can be used JsonKey and JsonConverter on the same field in order to define field name (with JsonKey) and to convert it (with JsonConverter)? Thanks

I have this `Destination` class where I store a `LatLong` object which also uses json serializable, and has a `latitude` and `longitude` field. I want the output of LatLong to...

My code: ```dart @JsonSerializable() class Person { @JsonKey( fromJson: unixTimeToDateTime, toJson: dateTimeToUnixTime, includeFromJson: true, includeToJson: true, ) DateTime dateOfBirth; Person({required this.dateOfBirth}); } DateTime unixTimeToDateTime(int secondsSinceEpoch) => DateTime.fromMillisecondsSinceEpoch( secondsSinceEpoch * 1000,...

e.g. I have a nullable list ['text', null] and write a safe conversion ``` @JsonKey(fromJson: safeList) List property; ``` ``` List safeList(dynamic value, {List defaultValue = const []}) => safeNullableList(value)...

Codegenerator logs error: > Could not generate `fromJson` code for `map` because of type `ItemId`. > Map keys must be one of: Object, dynamic, enum, String, BigInt, DateTime, int, Uri....

Thank you for providing the `FieldRename` enum. It quickly helps for common conventions. It's great, but some backends adopt some weird naming conventions. I recently had to interface my client...