Closed vfrank66 closed 3 years ago
sure, any contribution is welcome. Please keep in mind https://github.com/OpenAPITools/openapi-generator/issues/802 cc @TiFu
@macjohnny can do!
If you want to help the typescript refactoring, this would be very nice
Unfortunately, I currently don't have the capacity to actively work on the refactoring due to some other stuff going on in my life. However, the most basic features are supported in the new code base and kinda documented. If @vfrank66 decides to implement nestjs support in the refactored code base, I'd be happy to provide some guidance on that.
Otherwise, I think it would also be possible to just implement nestjs support by cloning one of the other generators and working from there. Integrating this new generator later in the refactored code base is not a big issue imo as most of the code generators require only either a) adapting the http request library and/or b) generating some boilerplate code.
Alright I'll help out, I see #802 and a lot of different issues. I will help get this converted in order to then add nestjs. Any contribution? Or what would you like completed first or what filter to use on the issues? @TiFu @macjohnny
Alright I'll help out
that's excellent, thank you!
@vfrank66 Thanks a lot! The code for the rework is currently on the typescript-refactor branch and follows the structure outlined in #802. So far I have added support for ts-fetch and I think jquery is almost done.
I think you could either try to add other generators (angular, rxjs, axios, node request module) support or just try to include nestjs in this new structure. My understanding so far is that nestjs significantly differs from the two generators I already implemented (the main difference between fetch & jquery being that the HTTP library is different - everything else is basically the same).
I think simply adding nestjs based on what's already there might be a good idea, so that we see if our structure is general enough to work with a variety of different frameworks. To better understand the structure, I would probably advise you to have a look at the ts-fetch generator first and try to adapt its approach. If there is specific code needed for nestjs, wrapping the API clients in another class (which would be located in the framework specific code
layer in the svg in #802) would be the right approach. If I can help you in any way, let me know and we can either discuss it on github or maybe even have a short skype call if that's easier.
I believe you don't have commit access to OpenAPITools, so if your changes are ready, you can just PR against typescript-refactor, tag me and then I'll have a look.
@TiFu okay I started looking at the code and the changes between master and typescript-refactor. Is this project still current https://github.com/OpenAPITools/openapi-generator/projects/4? It seems TODO's match up with what you responded with.
We can take this conversation outside of here if you would like, just let me know.
Yeah it is up-to-date. I will have a look at the TODO items tomorrow and see if I can make their titles a little bit clearer and add some more context.
We can take this conversation outside of here if you would like, just let me know. I don't have any preference, whatever helps you most.
This is a nice idea! @vfrank66 out of curiosity, what are your plans for the NestJS generated clients? I mean: how will they differ from the regular typescript-node
clients? Do you want to generate full services ready to be injected using Nest's DI?
@vfrank66 would you want to implement this in the current master, too? so it could be made available soon.
Sorry started this and then fell asleep on it, will complete this week.
@quezak - nestjs will be most similar to typescript-angular
with small exceptions like token injection, and decorator naming convention. With regards to these library similarities it will be injectable into the nestjs DI container as a nestjs service, or in nestjs terms module
just as angular codegen is injectable into angular DI. I have the code written and issue open with the swagger-openapi for reference if you would like to see it complete.
@macjohnny i am currently off typescript-refactor
or you asking me to switch that to master
and PR against master?
If you want to have your feature published in an official release soon I suggest you to file your PR against master. I don‘t know how long it will take for the typescript refactoring to land
@macjohnny thank you sorry work got in the way, so I have the code which I know works with the other swagger codegen setup. I seem to be having a problem getting the class loader to recognize the new generator. I followed the directions online just in case and no luck. So I am stuck but pushed what I have to my fork. I was hoping someone could explain to me what else besides adding a line to org.openapitools.codegen.CodegenConfig I need to do.
@wing328 can you help here?
Hello, I would also be interested in this feature. What is the current status?
@vfrank66 please file a PR to start with. We'll review and let you know what else needs to be done to get it merged into master.
@wing328 okay I can do that
@vfrank66 no need to apologize and we all appreciate your contributions to this project 👍
closed with #8522
@wing328 Sorry for a rather basic question, but is it only about a NestJS-compatible client generator, with server stub left out of scope?
@wing328 i was very surprised that with this new generator only client services can be generated. Nestjs is primarily used as server, will there be a server implemented also?
I haven't seen anyone working on a nest-specific server. However, we are always happy to review contributions, so if you have the capacity we would certainly welcome a nest server generator.
Happy to also point you in the right direction to get started if you are interested.
@TiFu I would love to do that, but I don’t have much Java knowledge. Please point out how I could start and I will see if I can find a way to develop that generator.
@pguso Couple pointers below:
Initial starting point should probably be:
From there, the NodeJS Express Server
generator is probably a good starting point. The relevant files can be found in:
In my mind, the ideal case for server generators would be similar to what we are trying to do with the consolidated typescript client generator:
This has the advantage, that bug fixes in the underlay then automatically apply across all server generators and there is little to no code duplication.
@pguso Is there any update on this? Have you started working on a nest.js server implemenation?
@pguso @michaeljauk @TiFu
do you guys have any update on nestjs server generator? I wanna contribute to the implementation.
Hi guys, @pguso @michaeljauk @TiFu has anybody started work on the NestJS Server Generator? Just checking as I want to use that Framework for a new project, but having finished my OpenAPI definitions I was wondering if I can use them to generate the Server Stubs. For now I only see the Node/Express in the Docs...
looking at https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages, there currently is a NestJsClient generator, so a server generator can be contributed
Should this be a new Request as this one is Closed?
@C0retek I think a new issue is good
Hello, Is there a chance to see nestjs support v9 of nestJS as HttpModule and HttpService are now imported from @nestjs/axios package ?
@Kalliser you can send a PR to implement this
Is your feature request related to a problem? Please describe.
There is already support for angular but we have been using typescript nestjs for our backend and frontend work. I would like to add support for nestjs.
Describe the solution you'd like
I would like this to be okay and I will work on the PR.
Describe alternatives you've considered
Additional context