json_to_dart icon indicating copy to clipboard operation
json_to_dart copied to clipboard

Provide hints to the generator to overwrite types

Open choiruru opened this issue 6 years ago • 1 comments

hi @javiercbk , Thanks for your awesome project, it is very helpful and saving much time when I want to generate json as dart class model.

But, sometime I found a weird json like this

[
    {
        "volume":123
    },
    {
        "volume":123.5
    },
    {
        "volume":null
    } 
]

it will be awesome if there is an option to cast all int and double as String in your project.. thank you

choiruru avatar Nov 30 '19 03:11 choiruru

Actually the library supports this but the frontend does not. I thought about providing hint to the generator and force it to choose a type even though it was not the one that it had detected.

this should be implemented in the frontend but sadly it is not a trivial amount of work.

javiercbk avatar Dec 13 '19 13:12 javiercbk