azure-functions-nodejs-openapi icon indicating copy to clipboard operation
azure-functions-nodejs-openapi copied to clipboard

error TS2344: Type 'T' does not satisfy the constraint '{}'.

Open astahl opened this issue 2 years ago • 1 comments

Hi, I'm encountering this error trying to compile my project with version 0.4.0 of your package, with TypeScript Version 4.9.5 and strict mode on.

node_modules/openapi-types/dist/index.d.ts:16:28 - error TS2344: Type 'T' does not satisfy the constraint '{}'.

16         paths: PathsObject<T>;
                              ~

  node_modules/openapi-types/dist/index.d.ts:15:34
    15     type PathsWebhooksComponents<T> = {
                                        ~
    This type parameter might need an `extends {}` constraint.

astahl avatar May 17 '23 13:05 astahl

As a work-around I was able to override the version selection of openapi-types in my packages.json:

  "overrides": {
    "openapi-types": "^12.1.0"
  },

my suggestion is to update the published version of the packages.json file to depend on a newer version on that library.

astahl avatar May 17 '23 13:05 astahl