Display value of header instead of *** in NestJS Swagger UI - nestjs

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

swagger - extract parameter info from express-validation

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

How Do I Update the Swagger UI Documentation in JHipster?

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 does Jhipster generate swagger info?

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..

I am using sails-swagger to generate the swagger docs i am getting only json format documnetation not swagger ui

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.

How can you set the swagger path in servicestack?

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");

Resources