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

Update SDK's serialization of REST-JSON API input and Content-Type #4116

Merged
merged 6 commits into from Oct 11, 2021

Conversation

jasdel
Copy link
Contributor

@jasdel jasdel commented Sep 30, 2021

Updates the SDK's serialization of REST-JSON based API input parameters into HTTP request message payload, and Content-Type are set correctly.

API operations with input structure members that are modeled to be serialized to the request payload will always have at least an empty JSON object serialized. Even if all members targeting the payload are nil.

Also changes REST-JSON serialization so that Content-Type is not sent if the input parameter has no members target the request payload.

Also updates SDK's API model loader to accept service-2.json module format.

Copy link
Member

@skmcgrail skmcgrail left a comment

Choose a reason for hiding this comment

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

Just a minor question on behavior for stub/synthetic input shapes, and looks like there is a panic around some reflection code.

@skmcgrail skmcgrail self-requested a review September 30, 2021 05:39
@jasdel jasdel force-pushed the fixup/RestJSONContentType branch 3 times, most recently from 6452eaa to 95c8877 Compare September 30, 2021 19:20
private/model/api/operation.go Show resolved Hide resolved
private/model/cli/gen-protocol-tests/main.go Outdated Show resolved Hide resolved
private/protocol/json/jsonutil/build.go Show resolved Hide resolved
private/protocol/rest/payload.go Outdated Show resolved Hide resolved
Updates the SDK's serialization of REST-JSON based API input parameters
into HTTP request message payload, and Content-Type are set correctly.

API operations with input structure members that are modeled to be
serialized to the request payload will always have at least an empty
JSON object serialized. Even if all members targeting the payload are
nil.

Also changes REST-JSON serialization so that Content-Type is not sent if
the input parameter has no members target the request payload.
@jasdel jasdel merged commit f51ef42 into aws:main Oct 11, 2021
@jasdel jasdel deleted the fixup/RestJSONContentType branch October 11, 2021 16:02
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.

None yet

3 participants