-
Notifications
You must be signed in to change notification settings - Fork 619
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
Conversation
* 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 |
There was a problem hiding this comment.
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!; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
bbbfff6
to
2183c10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
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. |
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;