-
Notifications
You must be signed in to change notification settings - Fork 584
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
Conversation
constructor( | ||
private readonly endpoint: HttpEndpoint, | ||
private readonly bodySerializer: BodySerializer | ||
) {} | ||
|
||
serialize(operation: OperationModel, input: any): HttpRequest<string> { | ||
serialize(operation: OperationModel, input: any): HttpRequest<never> { |
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.
Why did you choose never
over any
? Does the compiler effectively ignore the never
type?
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.
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.
You're a machine! My only comment is really more of a question. Feel free to merge. |
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. |
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.