#openapi generator

10 messages · Page 1 of 1 (latest)

acoustic citrus
#

Hello everyone, shour question related to the openapi-specification. I have a awgger.json and want to create a nestjs-controller for it. Is there some plugin avail for this ?
i alread checked the website, but found only a swagger-generator, generating the swagger from a nestjs-controller, but not the other way around.

BR

marsh verge
#

So it would have to be a code generator tool, right?
If you manage to make it work, please ping me
I’d like to create a blog post on this subject

acoustic citrus
gritty locust
#

They have a docker build with the CLI so you don't have to actually install java. Just run the image and pass it options

acoustic citrus
#

just one feedback: unfortunately the openapi-generator is only capable of creating a client-library for nestjs, no server-controller.

cunning dome
#

hi @acoustic citrus, I didn't want to create another thread for a similar question. did you find any way to create server controller files by using your yaml file? I also tested openapi generator for typescript-nestjs but it doesn't help at all. just creates client files..

acoustic citrus
#

i did not have a chance to look further into that matter, up until now nothing found

cunning dome
#

I see. thank you btw..

acoustic citrus
#

in the meantime i have found a solution that kind'a works for me. i generate typescript-client-bindings and write the controller-code by myself. The bindings are generated with "npm i--save-dev openapi-typescript-codegen" after that you can in your npm create a script like " "generate-typescript-ticketcontroller": "openapi --input ...../src/main/swagger/ticketcontroller/swagger.json --output ./src/openapi/ticket"