Skip to content

Commit

Permalink
fixing swagger setup using localhost as host name (apache#13254)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangfu0 authored May 29, 2024
1 parent fdfae5e commit 8a80b80
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
package org.apache.pinot.common.swagger;

import io.swagger.jaxrs.config.BeanConfig;
import java.net.InetAddress;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.UnknownHostException;
import org.apache.pinot.common.utils.PinotStaticHttpHandler;
import org.apache.pinot.spi.utils.CommonConstants;
import org.glassfish.grizzly.http.server.CLStaticHttpHandler;
Expand Down Expand Up @@ -50,12 +48,6 @@ public static void setupSwagger(String componentType, String resourcePackage, bo
beanConfig.setResourcePackage(resourcePackage);
beanConfig.setScan(true);

try {
beanConfig.setHost(InetAddress.getLocalHost().getHostName());
} catch (UnknownHostException e) {
throw new RuntimeException("Cannot get localhost name");
}

ClassLoader classLoader = SwaggerSetupUtils.class.getClassLoader();
CLStaticHttpHandler staticHttpHandler = new CLStaticHttpHandler(classLoader, "/api/");
// map both /api and /help to swagger docs. /api because it looks nice. /help for backward compatibility
Expand Down

0 comments on commit 8a80b80

Please sign in to comment.