chgeo / cds-swagger-ui-express

Swagger UI for CAP services
MIT License
13 stars 6 forks source link

Typescript-Support cds-swagger-ui-express #57

Closed Sandeep-Malhotra closed 9 months ago

Sandeep-Malhotra commented 1 year ago

Kindly guide me how to use cds-swagger-ui-express with Tyepscript Thanks in advance

chgeo commented 1 year ago

Please provide more details. What is the issue that you are facing?

Sandeep-Malhotra commented 1 year ago

My aim is to use swagger-ui-express in typescript file (server.ts) While trying to install types as dev dependencies I got an error ( npm i --save-dev @types/cds-swagger-ui-express)

image
chgeo commented 1 year ago

There is no @types/cds-swagger-ui-express. Just don't add it. cds-swagger-ui-express provides some type hints using JSDoc.

Sandeep-Malhotra commented 1 year ago

Thanks I got below mentioned error while trying to use in server.ts file

image
chgeo commented 1 year ago

Ok. As mentioned, this package has no TS support as of now.

This means you need to mitigate this fact when using the API. There are typical patterns afaik (use any type, use //ts-ignore etc.). But I am no TS expert I am afraid. There is lots of material out there that show you how to consume 'non TS-aware packages'.