Skip to content

[BUG] [dart-dio] No builder factory for BuiltMap<String, JsonObject> #6951

@flipch

Description

@flipch
Description

When describing an object whose type is a List<Dictionary<string, object>> dart-dio fails to generate a proper serializor prompting an exception

Deserializing '[a.b, 123]' to 'BuiltMap<String, JsonObject>' failed due to: Bad state: No builder factory for BuiltMap<String, JsonObject>. Fix by adding one, see SerializersBuilder.addBuilderFactory.
openapi-generator version

"@openapitools/openapi-generator-cli": "~1.0.13-4.3.1"

OpenAPI declaration file content or url
"ModelThatFails": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "object",
                "additionalProperties": false
              }
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
Command line used for generation

Options besides this only include the swagger file location and package name/version.
openapi-generator generate --enable-post-process-file -o headset_mobile_api

Steps to reproduce

Include that model and generate the dart code. Try and deserialize it with this example input
'[a.b, 123]'

Related issues/PRs
Suggest a fix

It seems the issue is within the Built_Value serializor or the Model that got generated. Not too knowledgeable in mustache templating

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