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

Invalid AWS JSON 1.1 protocol tests #1391

Closed
david-perez opened this issue Sep 8, 2022 · 0 comments · Fixed by #1392
Closed

Invalid AWS JSON 1.1 protocol tests #1391

david-perez opened this issue Sep 8, 2022 · 0 comments · Fixed by #1392
Labels
bug This issue is a bug.

Comments

@david-perez
Copy link
Contributor

We discovered in smithy-lang/smithy-rs#1708 that at least the following 36 @httpRequestTests (what follows are their ids) from the AWS JSON 1.1. test suite are invalid because they are missing the x-amz-target request header, which is required routing information in the AWS JSON 1.x protocols. Our AWS JSON 1.x router implementation in smithy-rs is thus currently failing to route the requests of these tests correctly:

json_1_1_client_sends_empty_payload_for_no_input_shape
json_1_1_service_supports_empty_payload_for_no_input_shape
sends_requests_to_slash

AwsJson11Enums

serializes_blob_shapes
serializes_boolean_shapes_false
serializes_boolean_shapes_true
serializes_double_shapes
serializes_empty_list_shapes
serializes_empty_map_shapes
serializes_empty_structure_shapes
serializes_float_shapes
serializes_integer_shapes
serializes_list_of_map_shapes
serializes_list_of_recursive_structure_shapes
serializes_list_of_structure_shapes
serializes_list_shapes
serializes_long_shapes
serializes_map_of_list_shapes
serializes_map_of_recursive_structure_shapes
serializes_map_of_structure_shapes
serializes_map_shapes
serializes_recursive_structure_shapes
serializes_string_shapes
serializes_string_shapes_with_jsonvalue_trait
serializes_structure_members_with_locationname_traits
serializes_structure_shapes
serializes_structure_which_have_no_members
serializes_timestamp_shapes
serializes_timestamp_shapes_with_httpdate_timestampformat
serializes_timestamp_shapes_with_iso8601_timestampformat
serializes_timestamp_shapes_with_unixtimestamp_timestampformat

AwsJson11ListsSerializeNull
AwsJson11MapsSerializeNullValues
AwsJson11ServersDontDeserializeNullStructureValues
PutAndGetInlineDocumentsInput
weihanglo added a commit to smithy-lang/smithy-rs that referenced this issue Sep 8, 2022
Missing `X-Amz-Target` in response header
weihanglo added a commit to smithy-lang/smithy-rs that referenced this issue Sep 9, 2022
* Make Instantiator generate default values for required field on demand

* Move looping over operations into ServerProtocolTestGenerator

Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>

* Add protocol test helper functions

Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>

* Add method param to construct http request

* Put request validation logic inside closure

Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>

* Make protocol test response instantiate with default values

* Add module meta for helper module

Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: david-perez <d@vidp.dev>

* Address most style suggestions

* add companion object for attribute #[allow(dead_code)]

Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>

* Use writable to make code readable

* recursively call `filldefaultValue`

Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>

* Exercise with `OperationExtension`

* Temporary protocol tests fix for smithy-lang/smithy#1391

Missing `X-Amz-Target` in response header

* Add `X-Amz-Target` for common models

Signed-off-by: Weihang Lo <weihanglo@users.noreply.github.com>
Co-authored-by: david-perez <d@vidp.dev>
Co-authored-by: Harry Barber <hlbarber@amazon.co.uk>
@milesziemer milesziemer added the bug This issue is a bug. label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants