pan3793 commented on a change in pull request #1363:
URL: https://github.com/apache/incubator-kyuubi/pull/1363#discussion_r750130579



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/api.scala
##########
@@ -56,17 +56,21 @@ private[api] object BackendServiceProvider {
 private[server] object ApiUtils {
 
   def getServletHandler(backendService: BackendService): ServletContextHandler 
= {
-    val servlet = new ServletHolder(classOf[ServletContainer])
-    servlet.setInitParameter(
-      ServerProperties.PROVIDER_PACKAGES,
-      "org.apache.kyuubi.server.api.v1")
-    servlet.setInitParameter(
-      ServerProperties.PROVIDER_CLASSNAMES,
-      classOf[KyuubiScalaObjectMapper].getName)
+    val openapiConf: ResourceConfig = new OpenAPIConfig
+    val servlet = new ServletHolder(new ServletContainer(openapiConf))
     val handler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS)
     BackendServiceProvider.setBackendService(handler, backendService)
-    handler.setContextPath("/api")
     handler.addServlet(servlet, "/*")
+
+    // install swagger-ui, these static files are copied from
+    // https://github.com/swagger-api/swagger-ui/tree/master/dist
+    val swaggerUI = new ServletHolder("swagger-ui", classOf[DefaultServlet])
+    swaggerUI.setInitParameter("resourceBase",
+      getClass.getClassLoader()
+        .getResource("META-INF/resources/webjars/swagger-ui/4.1.0/")

Review comment:
       Let's mark it in pom, when upgrade `swagger-ui`, we should also update 
it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to