Skip to content

Error generating typed list  #9

Description

@ArkadiuszDatka

Currently, the generator (version 0.5.3) incorrectly generates nullable typed lists

Domain model:

@Dto(generateToDto: false)
class A {
  final List<String>? a;

  const A({
    required this.a,
  });
}

Generated DTO model:

@JsonSerializable(createToJson: false)
class ADto {
  final List?<String> a;

  const ADto({
    required this.a,
  });

  factory ADto.fromJson(Map<String, dynamic> json) => _$ADtoFromJson(json);
}

Problem: The generated nullable typed list has bad syntax:

  • currently: List?<String> a;
  • expected: List<String>? a;

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