I have added the new header x-zp-auth-provider to Swagger UI by addSecurity and I want it to display its value instead of *****
Is there any way to do this?
Not out of the box.
You'll have to fork Swagger UI, modify the relevant code, rebuild the assets with your changes, and then configure NestJS to use your forked version instead of the standard Swagger UI.
The code that masks API keys and Bearer tokens with ****** is here:
api-key-auth.jsx
http-auth.jsx
Related
I'm new to node, swagger etc.
I'm working on a node.js app, I added some endpoints and using express-validation package I configured validators for my end points.
I now started using also swagger-autogen to generate swagger doc, but I can't find a way to make swagger use the validators in order to provide more data/limitations of the endpoints' parameters.
Is there a way to achieve something like that?
Thanks
In my JHipster app, I have manually updated the OpenAPI spec file (api.yml), following official instructions for API-first development.
However, the documentation (generated via Springfox) does not update, and still lists the endpoints described in the original (default) content of the api.yml.
As per Springfox's documentation,
All content is served from a webjar convention, relative url taking the following form: webjars/springfox-swagger-ui/2.9.2/swagger-ui.html
But there's no word about how to update that. Any ideas/clues welcome.
Thanks!
How/where does the swagger json for the swagger ui get generated ?
I thought maybe it was Springfox that was automatically doing it, but if I add a field without using the Jhipster 'entity creation' feature the field does not show up in the swagger docs. So obviously something generates it pre build..
This is the document i am getting but not the swagger ui. I want to get the document in swagger-ui format
I have used https://github.com/tjwebb/sails-swagger
sails-swagger doesn't provide swagger-ui. You need to set up it by yourself and point to /swagger/doc.
By default the documentation generated by swagger sits at /swagger-ui is there a simple mechanism to change this path to something more user defined such as /documentation?
The /swagger-ui/ and /swagger-ui-bootstrap/ paths are hard-coded to match the \swagger-ui and \swagger-ui-bootstrap folders and cannot be changed.
You could create a new Service or filter and redirect to them.
You can change the actual folder path from /swagger-ui/ to /documentation/. (make sure to search for the old swagger-ui string in the rest of the project and update the references where it makes sense, i think just in the index.html file)
Optionally, when registering your metadata plugins(if enabled) - you may want to update the Swagger link on the metadata page, which can be done by adding a link to the metadata swagger plugin
via appHost.GetPlugin()
.AddPluginLink("documentation/", "Swagger UI");