Skip to content

[BUG] [Dart] Map<String,List<int>> wrong deserialization #19997

@escamoteur

Description

@escamoteur
Description

this open-api spech part:

      "CollectionCalendarDto": {
        "type": "object",
        "properties": {
          "calendar": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            }
          },

generates correctly the property

  Map<String, List<int>> calendar;

but the fromJson method is wrong:

      return CollectionCalendarDto(
        calendar: json[r'calendar'] == null
            ? const {}
            : mapCastOfType<String, List>(json, r'calendar'),
        mostWornWatch: WatchTinyDto.fromJson(json[r'most_worn_watch']),
      );

the int is missing and as this is a required type it should have a trailing !

openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions