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

Feature/client generator #71

Merged
merged 3 commits into from
Nov 19, 2017
Merged

Feature/client generator #71

merged 3 commits into from
Nov 19, 2017

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented Nov 19, 2017

Getting pretty close to working now. Ran into a compiler error in the exported package that is the result of a bug in TypeScript >=1.6 that will be fixed in 2.7.

constructor(
private readonly endpoint: HttpEndpoint,
private readonly bodySerializer: BodySerializer
) {}

serialize(operation: OperationModel, input: any): HttpRequest<string> {
serialize(operation: OperationModel, input: any): HttpRequest<never> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you choose never over any? Does the compiler effectively ignore the never type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it's ignored because the stream type is merged into the body property's type union, meaning a serialized JSON-RPC request will have a body of string|ArrayBufferView|ArrayBuffer|undefined|never... it was the only way I could get the return type not to indicate that the response might be a stream without triggering a compiler error.

@chrisradek
Copy link
Contributor

You're a machine! My only comment is really more of a question. Feel free to merge.

@jeskew jeskew merged commit 858cefa into aws:master Nov 19, 2017
@jeskew jeskew deleted the feature/client-generator branch November 19, 2017 06:08
trivikr referenced this pull request in trivikr/aws-sdk-js-v3 Dec 10, 2018
@lock
Copy link

lock bot commented Sep 26, 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 Sep 26, 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