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

Signature of WebClientSession in @vertx/web-client needs updating #522

Open
outloudvi opened this issue Apr 19, 2021 · 1 comment
Open
Labels
bug Something isn't working
Milestone

Comments

@outloudvi
Copy link

As reported by tsc:

Class static side 'typeof WebClientSession' incorrectly extends base class static side 'typeof WebClient'.
  Types of property 'create' are incompatible.
    Type '(webClient: WebClient) => WebClientSession' is not assignable to type '{ (vertx: Vertx): WebClient; (vertx: Vertx, options: WebClientOptions): WebClient; }'.
      Types of parameters 'webClient' and 'vertx' are incompatible.
        Type 'Vertx' is missing the following properties from type 'WebClient': request, requestAbs, get, getAbs, and 10 more.

The code seems to build and work after I modified the following function signature in index.d.ts:

static create(webClient: WebClient) : WebClientSession;

to

static create(webClient: Vertx) : WebClientSession;
@pmlopes
Copy link
Contributor

pmlopes commented Apr 19, 2021

This is one of the limitations of vertx-codegen that needs manual patching. Thanks for reporting it!

The overload is tricky in this case, because it overlaps with a parent API interface... but it can be done with a override json

@pmlopes pmlopes added this to the 0.15.0 milestone Apr 19, 2021
@pmlopes pmlopes added the bug Something isn't working label Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants