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
add support for nullable struct members when generating AWS SDKs #2916
add support for nullable struct members when generating AWS SDKs #2916
Changes from 1 commit
9c17050
b1c7ec5
0f27839
81f428b
633c257
266f54f
86dc322
a5565a3
2d20462
acff7bd
976f3a2
397c4ab
80bb768
a44ae99
916265a
761c1e4
36b7127
3cf8288
7e464cc
d2b2c55
505c778
f0e4a1f
ae6a636
491ca43
66fbddb
c4b9958
dac4679
b0c63c9
5e6f6b9
94c8dbb
cd5e33c
1374e95
e661075
09c02f7
b417977
0bffcc0
eee07db
58cf184
7a4fd41
e75ad16
99de898
969e32f
7de1892
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 dropping it if it's not optional?
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.
AFAICT, this code is meant to set an error message. When the message is optional and wasn't provided, we set a generic message. This code isn't relevant when the message is required, as we can count on one being included in the response.
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.
It's unfortunate that I put so much effort into making the core classes agnostic from whether we were generating a client or a server when I implemented constraint traits, only to have these introduced again. I think it's best we make the core classes discriminate based on features that each artifact type has rather than on the artifacts themselves. To that end, a suggestion could be to pass to
JsonParserGenerator
a function that, given aStructureShape
, returns the code to finalize thebuilder
binding. That logic could be contained in the two builder generators (BuilderGenerator
,ServerBuilderGenerator
), and there we could make the checks tohasFallibleBuilder
in the client orreturnSymbolToParse
in the server.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.
I think this can be if
(hasFaillibleBuilder || !returnSymbolToParse.isUnconstrained)
?Alternatively, can we push
returnSymbolToParse
as an argument tohasFallibleBuilder
? That might help us make sure we caught all of these locations.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.
I don't see how the logic can be simplified that way. I also don't see how passing
returnSymbolToParse
as an argument tohasFallibleBuilder
simplifies things.returnSymbolToParse
is about whether we should parse a value for a shape into its associated unconstrained type. In the client this is alwaysfalse
because it has no notion of constraint traits.