feathersjs-ecosystem / feathers-swagger

Add documentation to your FeatherJS services and feed them to Swagger UI.
MIT License
225 stars 64 forks source link

How to stop autogeneration of swagger-json #257

Open paragkulkarni opened 10 months ago

paragkulkarni commented 10 months ago

I am searching for flag which stop swagger generation and used the custom json to generate swagger UI. Please let me know if I can use any flag to stop swagger generation json.

Mairu commented 10 months ago

Hi, the main goal of this library is to generate the specification. If you don't need that functionality you should not use the libray in my opinion.

To host a swagger UI install the swagger-ui-dist package and use express-static or koa-static to host the contents. You may need to adjust the swagger-initializer.js to set the path to your specification file.

You can check https://github.com/feathersjs-ecosystem/feathers-swagger/blob/master/lib/swagger-ui-dist.js to see how the library is doing it, but in your case no dynamic content should be needed.

You could also checkout https://github.com/wucf93/koa-swagger-ui-plus or https://github.com/scottie1984/swagger-ui-express