Skip to content
Advertisement

How to use Bearer or Apikey keywords automatically onswagger java

I am trying to make some security configurations in my SwaggerConfiguration class. My purpose is sending scheme keyword with authentication key like

JavaScript

or

JavaScript

It is possible on ASP.NET Core but I can only achieve this in Java like this:

enter image description here

What shall I use for my Docket security scheme instead of ApiKey?

JavaScript

Advertisement

Answer

You can achieve this by Open API Specification 3. To do that you need to add a dependency:

JavaScript

After including this you need to update the swagger configuration as and post that you do not need add Bearer scheme in front of your token:

JavaScript

For details you can refer this.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement