Skip to content
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

Http response code #1241

Merged
merged 7 commits into from
Jun 15, 2022
Merged

Http response code #1241

merged 7 commits into from
Jun 15, 2022

Conversation

82marbag
Copy link
Contributor

Issue #, if available: in smithy-rs, smithy-lang/smithy-rs#1229

Description of changes:
Add tests for http response code. These tests ensure that

  • @required and @httpResponseCode are correctly handled
  • @http's code is used in place of @httpResponseCode when the latter is not used

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Daniele Ahmed added 2 commits May 26, 2022 11:15
These tests ensure that
* @required and @httpResponseCode are correctly handled
* @http's code is used in place of @httpResponseCode when the latter is
  not used

They were not handled correctly in
smithy-lang/smithy-rs#1229.

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
@82marbag 82marbag requested a review from a team as a code owner May 26, 2022 11:23
@82marbag
Copy link
Contributor Author

CI fails due to some problems with cloudflare

Daniele Ahmed added 3 commits May 26, 2022 15:00
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
@82marbag
Copy link
Contributor Author

@srchase can you please restart the checks?

This test ensures that servers handle @httpResponseCode being @required.""",
protocol: restJson1,
code: 201,
body: "",
Copy link
Contributor

@gosar gosar Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See similar tests https://github.com/awslabs/smithy/blob/ededf6ba2334f1d006f3c76a257c8812f2f17497/smithy-aws-protocol-tests/model/restJson1/empty-input-output.smithy#L147-L159 and https://github.com/awslabs/smithy/blob/ededf6ba2334f1d006f3c76a257c8812f2f17497/smithy-aws-protocol-tests/model/restJson1/empty-input-output.smithy#L219-L221

server implementations are expected to respond with a JSON object regardless of if the output parameters are empty

You should change these tests to be similar to the above.

I think they way these tests are defined, it would have failed in the TypeScript SSDK - example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gosar, updated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they way these tests are defined, it would have failed in the TypeScript SSDK - example

Would it be useful to add some tests from those in this CI?

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
@gosar
Copy link
Contributor

gosar commented Jun 15, 2022

We are in the middle of a 1.22.0 release that is already prepped. This will be merged after the release. Merged in for 1.22.0

@gosar gosar merged commit 359fc17 into smithy-lang:main Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants