Created
October 26, 2015 19:02
-
-
Save jonocodes/e95999d34a643ef05519 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.swagger.models.Info; | |
import io.swagger.models.Swagger; | |
import io.swagger.models.auth.BasicAuthDefinition; | |
import javax.servlet.ServletConfig; | |
import javax.servlet.ServletContext; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServlet; | |
public class JerseySwaggerConfig extends HttpServlet { | |
@Override | |
public void init(ServletConfig config) throws ServletException { | |
Info info = new Info() | |
.title("Named Entity Database API"); | |
ServletContext context = config.getServletContext(); | |
Swagger swagger = new Swagger().info(info); | |
swagger.securityDefinition("basic", new BasicAuthDefinition()); | |
swagger.setBasePath("/vx"); | |
context.setAttribute("swagger", swagger); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment