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

Interface PathParameters does not work with Express Request generic #417

Open
svda opened this issue May 25, 2020 · 3 comments
Open

Interface PathParameters does not work with Express Request generic #417

svda opened this issue May 25, 2020 · 3 comments
Labels

Comments

@svda
Copy link

svda commented May 25, 2020

Express allows you to extend the Request interface using generics, i.e.
Request<Paths.CreateSubscription.PathParameters, {}, Paths.CreateSubscription.RequestBody>

The PathParameters interface this script currently generates does not play nicely with it however. You will get a typing error Index signature is missing in type 'PathParameters'.

This is solved if you change the interface the generator produces to a type instead since types infer the index signature:
type PathParameters = {...}

@horiuchi
Copy link
Owner

Perhaps the same problem as #406?

@svda
Copy link
Author

svda commented Jul 23, 2020

I don't think that one is related no.

@npdev453
Copy link

@svda, can you provide a repeatable example of that problem?

      export interface PathParameters {
          name: string;
      }
      Request<Paths.OperationOne.PathParameters, {}, {}>

works great for me.

dtsgenerator: 3.7.0
@types/express: 4.17.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants