Skip to content

Fix config signingName and Content-Type header for rest-json protocol #192

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

Merged
merged 3 commits into from
Jan 29, 2019

Conversation

AllanZhengYP
Copy link
Contributor

Fix the issues in code generator pinpoint client is usable now.

@c4k9c0
The first commit is the code change to code generator CLI;
The last commit is just generated code as example;

@AllanZhengYP
Copy link
Contributor Author

@c4k9c0 The fix for kerma config is merged in last PR

* If payload is supplied in input, the content-type should be set according to payload shape;
* If payload is specified but not supplied in input, no content-type header is needed;
* If there's no payload in input shape, set content-type as 'application/json';
* @param operation
Copy link

Choose a reason for hiding this comment

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

Add doc for input

} = operation;
if (protocol !== 'rest-json') return contentTypeHeader
if (typeof (inputShape.shape as Structure).payload === 'string') {
const payloadMemberName = (inputShape.shape as Structure).payload!;
Copy link

Choose a reason for hiding this comment

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

What is the ! doing at the end of this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The payload can be string or undefined. But in fact the payload here cannot be undefined because of the if statement. The ! is to persuade Typescript that payload always exists

@AllanZhengYP AllanZhengYP force-pushed the fix-config-signingname branch from bbbfff6 to 2183c10 Compare January 29, 2019 17:29
Copy link

@c4k9c0 c4k9c0 left a comment

Choose a reason for hiding this comment

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

Looks good!

@AllanZhengYP AllanZhengYP merged commit a7e6005 into aws:master Jan 29, 2019
@lock
Copy link

lock bot commented May 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants