Added example of how to apply json custom converter in freezed documentation #241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR aims to clarify two features from #240 and #232.
It adds two code examples on how to apply the custom converter decorator
MyResponseConverter
already present inside the documentation. Specifically, one example illustrates how to apply the decorator by passing it as a constructor parameter, while the second one shows that the converter works also on aList
parameter.It also adds a note below it to clarify that, in order to serialize nested list of freezer objects, you are supposed to either specify a
@JsonSerializable(explicitToJson: true)
or changeexplicit_to_json
inside yourbuild.yaml
file (taken from here).Note: The PR introduces a repetition. The reference to
build.yaml
to define some custom json_serializable flags is present both inside the PR and at the very bottom of the original documentation. I think the note may be helpful right below the json_serializable section to clarify the concepts explained above.