#Swagger create definition via command line

5 messages · Page 1 of 1 (latest)

shy patio
#

Is there a way to generate a swagger.json documentation file without running nest? Specifically I would like to generate the specifications in a pipeline. I was hoping for something like "swagger-codegen-cli" of swagger-codegen. Is there a way to accomplish this?

livid cloak
#

The application has to bootstrap in order to generate the swagger spec. What we did is create a separate entry point that can be called via the command line, which bootstraps the app, saves the swagger json and then exists (without triggering either init or listen on the app)

shy patio
#

That sounds perfect for my scenario; do you maybe have a code sample?

livid cloak
#

Basically just this

#

we use NX monorepo, which lets you select the entry point to the application, so we have 2 configurations with different entry points