swagger-api / swagger-node

Swagger module for node.js
http://swagger.io
Apache License 2.0
3.97k stars 584 forks source link

Does x-swagger-router-controller support typescript? #486

Open FieryCod opened 7 years ago

FieryCod commented 7 years ago

Question same as in title. Can I point in . yaml controllers to a ts file and in operationId point to a function implemented in a 'ts' file? If so please tell me how to do it. More preceisly: Will swagger-node support typescript?

0v3rst33r commented 7 years ago

@FieryCod Did you come right? I am also interested in this.

meisterlampe commented 7 years ago

Typescript compiles to JavaScript. So it is no problem to use it. Just change all .js files to .ts files and add some types or other typescript stuff . Compile the project and run it from the output folder. Haven't tried to use classes though..

FieryCod commented 7 years ago

@meisterlampe Why compile? There is ts-node so he can run .ts files via ts-node. @0v3rst33r We did not choose the swagger-node , but swagger-tools

meisterlampe commented 7 years ago

@FieryCod Right, but ts-node also transpiles to JavaScript and uses normal node afterwards.

0v3rst33r commented 7 years ago

@FieryCod I had a look at swagger-tools now and looks quite handy in terms of a lot of boiler plate code one does not have to do. I do see they are busy splitting it up in 3 projects (Deprecating swagger-tools).

FieryCod commented 7 years ago

The maintainer of swagger-tools told me about month ago (June 2017) that in short time there will be the next release of swagger-tools so I do not think it gonna be deprecated in couple of years. But of course I am not 100% sure. You can ask maintainer when specifically the new release is likely to happen on apigee's swagger-tools gitter.