-
Notifications
You must be signed in to change notification settings - Fork 412
Improve toJson generation with some no-write null fields #33
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
Conversation
CHANGELOG.md
Outdated
@@ -1,3 +1,8 @@ | |||
## 0.2.3 | |||
|
|||
* Write out `toJson` methods more efficiently the first fields written are not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this missing a word or some punctuation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
$map['orders'] = orders; | ||
return $map; | ||
writeNotNull('middleName', middleName); | ||
val['lastName'] = lastName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can/should we get these other non-null fields into the initial map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, no. We want to keep the fields in consistent order.
'firstName': firstName, | ||
}; | ||
|
||
void writeNotNull(String key, dynamic value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking a look at this - I might skip the extra method and inline the conditionals through the rest. It's noisy but shouldn't matter since it's generated code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm. Maybe. Will look at in another.
No description provided.