feat: Add JsonSerializable(createJsonMeta)#1164
Merged
Merged
Conversation
1b692aa to
e386254
Compare
kevmoo
reviewed
Jun 24, 2022
| /// | ||
| /// This constant can be used by other code-generators to support features | ||
| /// such as [fieldRename]. | ||
| final bool? createJsonMeta; |
Collaborator
There was a problem hiding this comment.
"meta" is pretty vague here. Maybe createFieldMap? Let's talk before you start rewriting everything...
Contributor
Author
There was a problem hiding this comment.
xFieldMap sounds good to me
kevmoo
reviewed
Jun 24, 2022
| assert(config.createJsonMeta); | ||
|
|
||
| final buffer = | ||
| StringBuffer('const _\$${element.name}JsonMeta = <String, String> {'); |
Collaborator
There was a problem hiding this comment.
Careful using element.name – if it's already private you'll end up with double _ which makes analyzer sad.
I have a helper around here somewhere for this"
Contributor
Author
There was a problem hiding this comment.
Done. I haven't seen another util for this
kevmoo
reviewed
Jun 24, 2022
00036b9 to
5d00aad
Compare
Collaborator
|
still hacking on the failures @rrousselGit ? |
Contributor
Author
|
Indeed. I don't quite understand why the CI says generated code is outdated. It isn't for me locally |
Collaborator
|
@rrousselGit – need to do another rebuild. After a |
kevmoo
reviewed
Jun 27, 2022
Contributor
Author
|
Looks like it's good now 😄 |
Collaborator
|
good job on this! |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As discussed before, this adds an option for generating a constant Map of
property name: json namefixes #972