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
17.01k stars 6.03k forks source link

[Nestjs] Typescript Nestjs New Language Generator #9559

Open vfrank66 opened 5 years ago

vfrank66 commented 5 years ago
Description

We use nestjs as our backend and frontend node applications. Currently there is support for angular 2-6 but not nestjs. I proposed adding nestjs.

Swagger-codegen version

N/A

Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

I have the changes locally and would like to PR.

imdurgadas commented 3 years ago

@vfrank66 is the PR merged or is this support available anywhere ?

lchenneberg commented 2 years ago

It would be nice to have this feature merged

taylor-lindores-reeves commented 2 years ago

Would be great to use this.

AaronLiuIsCool commented 1 year ago

It would be good to have this feature in 2022

taylor-lindores-reeves commented 1 year ago

How can we contribute to make this happen?

cassepipe commented 1 year ago

Still hoping

taylor-lindores-reeves commented 1 year ago

Guys highly recommend checking out Redocly plug-in - managed to get it working with Fastify NestJS.

dinbtechit commented 1 year ago

Guys highly recommend checking out Redocly plug-in - managed to get it working with Fastify NestJS.

@leafyshark Thank you for sharing. Would you happen to have a link for the Redocly plugin?

taylor-lindores-reeves commented 1 year ago

@leafyshark Thank you for sharing. Would you happen to have a link for the Redocly plugin?

It's the redoc npm package. I found the perfect implementation here:

https://github.com/Statsify/statsify/blob/bdd0e02d2c7cc2fa95a9fdaa6298cd0c6d289e87/apps/api/src/index.ts#L89 https://github.com/Statsify/statsify/blob/bdd0e02d2c7cc2fa95a9fdaa6298cd0c6d289e87/apps/api/src/app.controller.ts

dinbtechit commented 1 year ago

hmm.. I can't anything in that doc about generating client code for typescript-nestjs.

but I did find another library that does that https://www.npmjs.com/package/@openapitools/openapi-generator-cli

Install:

npm -g i @openapitools/openapi-generator-cli 

and generate nestjs httpclient code

 openapi-generator-cli generate -g typescript-nestjs -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o pet-project-nestjs

Hope this helps!