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.
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
3.0.0: Improve object encoding and decoding #862
3.0.0: Improve object encoding and decoding #862
Changes from 26 commits
d003221
6bdc9ba
6e80bd6
71999a6
6f58347
312fd65
04af841
564c889
6637ead
6235396
1ecb5e2
abcbd9a
d6c4913
54aeb78
3b99c59
3d911fc
65e0724
381347d
7e6ca55
0a493ae
272df51
b11917b
3016e9a
ce0d857
d72e724
b864c24
f79528e
6c90132
8a29264
f67acb6
d11db00
c82a856
86a6e11
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
imo this interface from user point of view is too verbose. Can't
fromEncodingData
check if it is getting raw json or a encodingSchema-compatible dict ?This pattern repeats over and over and over except few places where dicts supplied into
fromEncodingData
.Well, unless all these verboseness is only in auto-generated and not exposed to end user.
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.
Yes this is pretty verbose and not very nice.
When decoding from a serialized JSON string,
decodeJSON
can be used, e.g.decodeJSON(str, AccountApplicationResponse)
. This is what I expect users will need the vast majority of the time, not the verbose code present in the request classes.In these request classes, we are in a bit of weird situation when
prepare
function is called, since the JSON response is already parsed into an object. I have a desire to change this so that the JSON string is the input toprepare
, thendecodeJSON
can be used and the code would be cleaner. But this PR has already grown large, so I didn't want to attempt that now.