Still working on this. I looked through the samples marked "Spring Boot" and "Jersey" at
https://github.com/swagger-api/swagger-samples, but it appears that the Spring Boot examples don't add custom authentication, and the non-Spring Boot examples all use the same Bootstrap.java file which assumes I am directly using the HttpServlet class. One of the Spring Boot examples uses SpringFox which I've already committed to not using that.
Since the HttpServlet class is configuring Swagger inside the init() function in the "Bootstrap.java" examples. The significant difference between the HttpServlet code and the Application() code seems to be that HttpServlet.init() has ServletConfig as a parameter, so I tried using ServletConfigAware and adding the swagger.securityDefinition() code (as in
https://github.com/swagger-api/swagger-samples/blob/master/java/java-jersey-jaxrs/src/main/java/io/swagger/sample/Bootstrap.java#L31-L35) into the setServletConfig method. I tried this in both my Spring Boot Application class and the Jersey ResourceConfig class. Neither of these succeeded in making the Basic Auth definition I added show up in /swagger.json.
Any direction appreciated.
Once I get the Basic Auth information to show up in /swagger.json, will Swagger UI automatically pass Basic Auth headers to its "try it" API calls? I've been looking for information about the level of support for Basic Auth in Swagger UI and have come with a variety of stories. I'm not sure at this point whether I can edit the index.html, need to rebuild the project, or it will "just work" once I have Basic Auth showing up in /swagger.json.