-
Notifications
You must be signed in to change notification settings - Fork 193
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 server extra tests #1497
Add server extra tests #1497
Conversation
Signed-off-by: Daniele Ahmed <[email protected]>
Signed-off-by: Daniele Ahmed <[email protected]>
A new generated diff is ready to view.
A new doc preview is ready to view. |
If you want, just add the suite in this PR without adding the tests mentioned in #1164. We can tackle #1164 in a separate PR. #1164 also talks about doing this:
|
Signed-off-by: Daniele Ahmed <[email protected]>
Ok, changed this PR to move towards that instead |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Is this PR still relevant? |
A new generated diff is ready to view.
A new doc preview is ready to view. |
@@ -78,7 +78,8 @@ service RestJsonExtras { | |||
code: 500, | |||
body: "", | |||
headers: { "X-Amzn-Errortype": "ExtraError" }, | |||
params: {} | |||
params: {}, | |||
appliesTo: "client", |
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.
This test fails for the server because servers are expected to serialize {}
when the output parameters are empty.
Hence why we have a serverStructureSerializer
that behaves like that. We should arguably modify the Kotlin docs for serverStructureSerializer
calling this out.
Anyway, this test can remain for the client only, but we should duplicate it in a new test that only applies to the server and that has body: "{}"
, and copy over the documentation from RestJsonGreetingWithErrors
to justify why we're doing so.
@@ -302,7 +307,8 @@ operation CaseInsensitiveErrorOperation { | |||
code: 500, | |||
body: "{\"Message\": \"hello\"}", | |||
headers: { "X-Amzn-Errortype": "CaseInsensitiveError" }, | |||
params: { message: "hello" } | |||
params: { message: "hello" }, | |||
appliesTo: "client", |
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 would expand the documentation to justify why this is a client-only test; took me a while to figure out why. It turns out that smithy-rs clients should be able to parse error messages if the JSON keys them as message
, Message
, or errorMessage
. The relevant parsing code is here.
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.
Added a comment with the link
Signed-off-by: Daniele Ahmed <[email protected]>
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: i'd place documentation inside the documentation
field instead of in a comment in the Smithy file, so that it gets rendered in the protocol test.
Signed-off-by: Daniele Ahmed <[email protected]>
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
See: #1164
Description
Tests:
Testing
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.