Closed apgapg closed 3 years ago
@apgapg Hi,
I was working on this right now to add json keys for Freezed
class. But I see I'm too late :) after merging I will check if everything work well and correct if needs. Thanks for your opinion.
@iamarnas is it ok to merge? I am not updated with flutter these days
@iamarnas Sure. But I see only the name
option can be utilized herein @JsonKey
, others like defaultValue cannot be used here without user consent.
Are there any other you planned to include in JsonKey except name?
@hiranthaR Hi, Is OK. Everything looks good.
@apgapg Hi.
Are there any other you planned to include in JsonKey except name?
Right now I am working with more accurate generating for deeply nested json files, it is more important right now. What about Freezed I have not more idea just trying keep it clean and thought fix better support for json, need more opinions from users. You opinion is welcom :)
@apgapg Hi,
Others like defaultValue cannot be used here without user consent.
It is possible to add default values from the json file examples, most values have some example values to define value types. But Freezed has so many options that it is better to leave it to the users consent like you say. Anyway after generated classes, it is easy to edit. Just edit row and run builder.
@apgapg HI!
@iamarnas Sure. But I see only the
name
option can be utilized herein@JsonKey
, others like defaultValue cannot be used here without user consent. Are there any other you planned to include in JsonKey except the name?
You asked about more futures :) The latest version 3.1.5 supports default values and required, more... All suggestions on how to improve code are welcome.
Describe the bug
Suppose a json look like this:
The output freezer class variable would become camelcase which will not correctly parse the field as it is in pascalcase. Ideally
@JsonKey(name:'FieldA')
must be there above this variable generated.Additional context The problem lies in
fixFieldName
method inhelper.dart
which makes field name to camel case