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
feat: add support for
smithy.protocols#rpcv2Cbor
protocol #1103feat: add support for
smithy.protocols#rpcv2Cbor
protocol #1103Changes from 84 commits
6eb23d0
46473e0
f210817
714b04b
aa57a2d
d212ac0
0d8daae
c3f6f31
add554f
61cc03a
0e92a58
6c8b1fa
2d998f3
b3f6d0c
0f2a9ef
ac31d50
1184b7b
6718936
859111a
1f777c6
1763955
20468df
b0b1b87
5046ddc
4ee5366
a7a62e4
b895e4f
045fb5b
4057079
e7fdc80
975e97a
f6b5fd4
80f37de
c662ee8
9bdc4a3
ba0382c
89981e1
93c454e
ffbfd6a
59fc1bf
4c19672
6336085
de302e9
c1dff2f
81ee676
1012069
7cf68a9
54b9407
a2c8e21
307e78f
ee86760
06414a1
5570862
613a4fe
71bc4fe
6fdf110
9cf6ba7
f467bfb
95542d3
8f86350
638d1aa
0ed06d6
5a85556
9dcc7a6
829e333
a8bc2c7
1883661
03060ff
01dbc4a
246323a
6484781
588101e
8c0c320
cd41ebc
a9ed26a
535864f
5821ffd
af4d9fe
7335806
66b738e
4e2938a
de03d4e
8a8888b
3a40040
9fa0846
a19da6c
7f7b133
c2e9fd6
ebd3fde
5750ba4
c9069a5
ad5f77c
f5143b0
d5d6c6c
8567688
7c5f14a
61037b3
4918bf1
788a8d5
6db7b63
b8df86d
b5a29dd
2284b2e
9f14b26
5e63377
6342fc5
32e3756
6b64147
7eb67cd
de6f9ff
c13956c
00a1862
58bbe52
e1fd290
0ad4d50
770519f
104f4aa
5cad413
cb83f4d
b6e36a5
2c41bc3
6791e40
764fea6
5d397c1
186735c
6c80127
bcca021
88a42bd
061ee7d
febe4e7
db158d2
840ab18
49f07fa
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.
Question: This protocol doesn't use any timestamp formatting at all, correct? If so, using
UNKNOWN
feels wrong. Seems like it should just benull
. This might also be an indication that we are missing an abstraction somewhere.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 can't be
null
because thedefaultTimestampFormat
is non-nullable. We could change the interface and make it nullable but that introduces a large swath of changes that I'm not sure are appropriate.We might be missing an abstraction, I definitely found some broken assumptions during this implemtation since this is our first binary protocol. It's not immediately clear to me how these can be separated out though.
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.
Nit: This is a copy of
HttpBindingProtocolGenerator
'srenderSerializeHttpBody
, notAwsHttpBindingProtocolGenerator
.Question: Why doesn't the existing
HttpBindingResolver.hasHttpBody
method work here? Could it be made to work for this protocol and thus eliminate the need for so much code duplication?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.
The existing
hasHttpBody
returnstrue
if there are any request members bound to the payload. The rpc-v2-cbor spec says:This difference was causing some protocol tests to fail. For example, when an input targets a non-Unit shape which doesn't have any request members, the original
hasHttpBody
would returnfalse
, but the CBOR spec expectstrue
.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.
Do you mean something like:
Wouldn't the non-CBOR protocols also have no body in that case?
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 that's correct, in this example, non-CBOR protocols would have no body, but CBOR is expected to send a body.
Here is the specific protocol test that fails without this custom
hasHttpBody
function: https://github.com/smithy-lang/smithy/blob/main/smithy-protocol-tests/model/rpcv2Cbor/empty-input-output.smithy#L106It fails because there is no
Content-Type
header sent, but it is requiredThere 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.
Question: What is
TimestampFormatTrait.Format.EPOCH_SECONDS
used for?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 not used, it could be any value,
TimestampFormatTrait.Format.UNKNOWN
might be better. This is related to your previous comment about unused timestamp format but it will be tricky to untangle