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

Parse request and response payloads strictly #405

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

adamthom-amzn
Copy link
Contributor

@adamthom-amzn adamthom-amzn commented Aug 26, 2021

Issue #, if available:

Description of changes:
If a restJson1 protocol request or response is a structure (as opposed to being
a bound payload), it must be a non-null JSON object. If it's a payload bound to
a union or structure, it must be a JSON object. Previously, body parsing would
take any output from JSON.parse and attempt to pull members off of the result
by name, even if JSON.parse returned a non-object type.

This depends on aws/aws-sdk-js-v3#2713 - client changes are demo'd on my fork here: adamthom-amzn/aws-sdk-js-v3#22 and protocol tests pass.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

If a restJson1 protocol request or response is a structure (as opposed to being
a bound payload), it must be a non-null JSON object. If it's a payload bound to
a union or structure, it must be a JSON object. Previously, body parsing would
take any output from JSON.parse and attempt to pull members off of the result
by name, even if JSON.parse returned a non-object type.
@adamthom-amzn adamthom-amzn merged commit 927b96e into smithy-lang:main Aug 30, 2021
@adamthom-amzn adamthom-amzn deleted the strict-body-parsing branch August 30, 2021 18:43
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