Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [dart-dio-next] Map will nullable value #10465

Closed
jaumard opened this issue Sep 23, 2021 · 5 comments · Fixed by #11011
Closed

[BUG] [dart-dio-next] Map will nullable value #10465

jaumard opened this issue Sep 23, 2021 · 5 comments · Fixed by #11011

Comments

@jaumard
Copy link
Contributor

jaumard commented Sep 23, 2021

I need to generate a Map of String, Object. So my definition look like this:

template:
          type: object
          nullable: true
          additionalProperties:
            type: object
            nullable: true

I was expecting that

@BuiltValueField(wireName: r'template')
BuiltMap<String, JsonObject?>? get template;

But got this:

@BuiltValueField(wireName: r'template')
BuiltMap<String, JsonObject>? get template;

So of course it crash a runtime when something null is on the map :(

@jaumard
Copy link
Contributor Author

jaumard commented Sep 23, 2021

Look like there is much to generate, FullType(JsonObject) have to become FullType.nullable(JsonObject), and a new entry on serializers.dart have to be managed so it can be handled.

@kuhnroyal
Copy link
Contributor

Which version did you use? There were some changes in #10118

@jaumard
Copy link
Contributor Author

jaumard commented Oct 5, 2021

Look like I am using 5.2.1, is that changes out in a release yet?

@kuhnroyal
Copy link
Contributor

No, that commit is only on master.

@kuhnroyal
Copy link
Contributor

@jaumard Can you try this again please with the recent fixes on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants