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

nullable array fields are not handled properly in the generated fromJson #140

Open
alexpyc opened this issue Mar 21, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@alexpyc
Copy link

alexpyc commented Mar 21, 2024

Description of the bug

A field is defined as nullable array. Yet it will be generated to have empty List in dart which causes an issue as there is a difference between null and empty List in my case.

Steps to reproduce

SomeObject:
    type: object
    properties:
        category_ids:
            nullable: true
            type: array
            items:
                type: string

Expected behavior

SomeObject currently has the field categoryIds which is nullable List in dart. However it is expected that in fromJson, it can differentiate between null and empty array

Logs

No response

Screenshots

No response

Platform

Linux

Library version

4.13.1

Flutter version

3.10.6

Flutter channel

stable

Additional context

No response

@alexpyc alexpyc added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant