dtsgenerator
dtsgenerator copied to clipboard
Interface PathParameters does not work with Express Request generic
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 = {...}
Perhaps the same problem as #406?
I don't think that one is related no.
@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