question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong type definition for OperationHandlerArray

See original GitHub issue

Hello, When defining operations in typescript we can use the type Operation which is either OperationFunction | OperationHandlerArray.

The problem is that OperationHandlerArray is an OperationFunction[]. The apiDoc property becomes a property of every elements of the array instead of the whole array.

Here is the project @types/express-openapi with the correct typing : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express-openapi/index.d.ts#L266

Is it possible to fix that typing issue ? It prevents the use of apiDoc on endpoints with middlewares.

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
miklosaubertcommented, Oct 24, 2019

thanks @jsdevel ! Just noticed the new version 😃

0reactions
jsdevelcommented, Oct 24, 2019

thanks for the bump!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to overwrite incorrect TypeScript type definition installed ...
Say that I want to use dotenv module in my TypeScript project and install its .d.ts using npm install @types/dotenv --save . Then...
Read more >
error TS2688: Cannot find type definition file for...random paths.
Basically anything that tries to do typescript gets a bunch of errors about not finding type definitions I never reference in any of...
Read more >
TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >
Override TypeScript type definition of npm package - YouTube
Your browser can't play this video. Learn more. Switch camera.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found