nestia icon indicating copy to clipboard operation
nestia copied to clipboard

Add swagger generation with --watch mode / live reload

Open loucass003 opened this issue 1 year ago • 2 comments

Please add a way to support live reloading with nestia

For instance in our project we use the swagger.json file

import swaggerDocument from '../swagger.json';

SwaggerModule.setup('/api', app, swaggerDocument as OpenAPIObject, {
    swaggerOptions: {
      defaultModelRendering: 'model',
      tryItOutEnabled: true,
      syntaxHighlight: {
        activate: true,
      },
    },
});

Then we run the nestia swagger command to regenerate the schema. this will trigger a file change of the swagger.json and we can watch that to restart the app. , It would be nice to have nestia to watch for changes and re generate the schema when a controller change.

This would be a really nice 'ease of use' feature.

I guess we could try to make a webpack plugin that run the command when a controller change but i think it would be better if it was handled by nestia itself.

Thanks again for this great tool <3

loucass003 avatar Nov 28 '23 14:11 loucass003

I think it would be nice to have multiple swagger definitions merging out of box to simplify migration to nestia.

Timur2915 avatar Dec 03 '23 00:12 Timur2915

Good idea, but do not know how to, and not enough ime to study right now.

Hope someone to contribute about this.

samchon avatar Dec 03 '23 07:12 samchon