Skip to content

JsonSerializableGenerator Generated code issue #13

Description

@gerryau

My code generation seems to be missing the .map function for the todos in the generated file

Map<String, dynamic> _$_$_NoteDtoToJson(_$_NoteDto instance) =>
    <String, dynamic>{
      'body': instance.body,
      'color': instance.color,
      //  'todos': instance.todos, <- my code generation looks like this
      'todos': instance.todos?.map((e) => e?.toJson())?.toList(),
      'serverTimeStamp':
          const ServerTimestampConverter().toJson(instance.serverTimeStamp),
    };

What part of your code controls this generation to map it like this? My code works if I manually change this.

Running the same version of json_serializable and json_annotation as you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions