swagger
swagger copied to clipboard
Make JSON endpoint customizable using an option variable
Is there an existing issue that is already proposing this?
- [X] I have searched the existing issues
Is your feature request related to a problem? Please describe it
Hi, I have been looking into the issues and docs but I think that the feature i'm requesting is not available and it can be useful for me and other people.
Right now the swagger json is deployed in ${finalPath}-json
, for example:
http://localhost:3000/api-json
Describe the solution you'd like
I would like to have the json full path customizable, for example, instead of being /api-json
, I would like to have:
/api-docs
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
That's because we have more applications with the swagger json served in that path.
Thanks in advance
Would you like to create a PR for this?
@jcolladosp You working on PR ?
Hi @Tushar1998 and @kamilmysliwiec I would try to work on a PR during next week. Thanks for your time
Hi @tushar1998 ,
I'm starting to work on the PR.
Where do you think I should add the new parameter to specify the path name for the json?
Should it be in SwaggerDocumentOptions
or in SwaggerCustomOptions
of the setup function?
Thanks
Hi @jcolladosp,
If you look closely serveDocuments
private method is reponsible to serve json and yaml output
And SwaggerModule.setup()
calls serverDocuments so SwaggerCustomOptions
would be the answer
Tip: Also make yaml endpoint configurable
HI @tushar1998, thanks for the answer.
I also tought that SwaggerCustomOptions
should be the right place, but later I saw in the documentation that these are custom options for Swagger UI, so I'm not sure if it's the place
Best regards, Jose
I guess we can close this now.
@jcolladosp Could you please update de docs?