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

Allow extra non-serializable fields to be passed into fromJson and ignored in toJson #783

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hacker1024
Copy link

@hacker1024 hacker1024 commented Jan 1, 2021

This PR adds a feature to allow non-serialisable data to be passed into fromJson and ignored in toJson.
Syntax and an example use case is discussed in #780.

This is currently in draft status due to the lack of tests. I'm a little confused about how to implement testing here - is testing this feature alone in a class good enough, or does it need to be tested with other regular fields as well?

Resolves #780.

@hacker1024
Copy link
Author

Analysis is failing because json_serializable depends on json_annotation from pub.dev, but json_annotation needs changes as well.

@hacker1024
Copy link
Author

hacker1024 commented Feb 17, 2021

Does anyone have any comments to add? Thoughts, ideas?

@hacker1024
Copy link
Author

@google?

@ciriousjoker
Copy link

@hacker1024 I assume Google will just ignore PRs that fail the tests. Fix them and try again? idk...

…nored in toJson

Document JsonKey.extra

Add extra key to KeyConfig class


Fixes
@kevmoo
Copy link
Collaborator

kevmoo commented Oct 1, 2022

Any interest in this?

@Nico04
Copy link

Nico04 commented Oct 3, 2022

Yes totally, in some cases it would be very usefull !

@kevmoo
Copy link
Collaborator

kevmoo commented Oct 4, 2022

I'll need a changelog update and tests...and a rebase 😄

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

Successfully merging this pull request may close these issues.

Allow extra non-serializable fields to be passed into fromJson and ignored in toJson
4 participants