swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.88k stars 6.03k forks source link

nodejs and express middleware #2197

Open rajeget opened 8 years ago

rajeget commented 8 years ago

The codegen server stub , creates the 'connect' middleware . Is there a way to create express middleware. Express is more popular . If yes, howto . If no, can I put a request for it ?

Thanks _Raje

fehguy commented 8 years ago

There is not, but many have asked. Let's keep this open to track the issue.

rajeget commented 8 years ago

I kind of worked around , replaced : app = require('connect')(); replaced with : app = require('express')(); And ofcouse installed express .

This seems to have worked . Will review it for more route/validate etc . If that works will contribute this small alternation to the project.

If someone already have idea - as to if I am going in wrong direction please correct. Can contribute a better express server stub . But would require guidance.

-Raje

fehguy commented 8 years ago

Thanks! I can help integrate your changes into the templates and make it selectable from the generator. Just let me know how your testing goes and share your package.json and change to the js file

FilipHarald commented 7 years ago

@rajegit did you end up using Express or Connect? And how did it work out for you?

wing328 commented 7 years ago

@FilipHarald if you've time to work on the NodeJS express generator, please let me know and we can work together on that.

FilipHarald commented 7 years ago

@wing328 unfortunately I do not have time at the moment. I ended up using swaggerize-express instead. Thank you for inviting me to contribute anyways!

wing328 commented 7 years ago

@FilipHarald np and thanks for sharing swaggerize-express, which looks good. I'll give it a try as well.

bajtos commented 7 years ago

FWIW, we provide a swagger-to-server-models generator in LoopBack, our API framework built on top of express. See https://loopback.io/doc/en/lb2/Swagger-generator.html to get started.

linuxbandit commented 5 years ago

Hello! Is there any update on this?

Vichy97 commented 5 years ago

+1

HugoMario commented 5 years ago

hi @linuxbandit @Vichy97 it seems this ticket is a bit forgotten. i'm just starting to get involve with nodejs but i'm pretty familiar with codegen. if you guys guide me for the expected output i could help you with a solution for this.

dushansilva commented 4 years ago

Hi guys, Any update on this? Looking for a server stub generation with express, I was surprised to see its not already available out of the box

jydenberg commented 4 years ago

Any news on this one?

abiriadev commented 2 years ago

any updates here?

maxbec commented 1 year ago

Is there any plan to implement ExpressJs here?

mnesarco commented 1 year ago

Hello, any news about express support in 2023?