Jackie-Jiang commented on code in PR #13122: URL: https://github.com/apache/pinot/pull/13122#discussion_r1599173919
########## pinot-common/src/main/java/org/apache/pinot/common/swagger/SwaggerSetupUtil.java: ########## @@ -0,0 +1,69 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +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; +import org.glassfish.grizzly.http.server.HttpServer; + + +public class SwaggerSetupUtil { + private SwaggerSetupUtil() { + } + + public static void setupSwagger(String componentType, String resourcePackage, + boolean useHttps, boolean setHost, String basePath, ClassLoader classLoader, HttpServer httpServer) { + BeanConfig beanConfig = new BeanConfig(); + beanConfig.setTitle("Pinot Server API"); Review Comment: This is not the same for each component, consider passing it in as argument ########## pinot-broker/src/main/java/org/apache/pinot/broker/broker/BrokerAdminApiApplication.java: ########## @@ -115,14 +112,14 @@ protected void configure() { bind(startTime).named(BrokerAdminApiApplication.START_TIME); } }); - boolean enableBoundedJerseyThreadPoolExecutor = - brokerConf.getProperty(CommonConstants.Broker.CONFIG_OF_ENABLE_BOUNDED_JERSEY_THREADPOOL_EXECUTOR, + boolean enableBoundedJerseyThreadPoolExecutor = brokerConf + .getProperty(CommonConstants.Broker.CONFIG_OF_ENABLE_BOUNDED_JERSEY_THREADPOOL_EXECUTOR, CommonConstants.Broker.DEFAULT_ENABLE_BOUNDED_JERSEY_THREADPOOL_EXECUTOR); if (enableBoundedJerseyThreadPoolExecutor) { register(buildBrokerManagedAsyncExecutorProvider(brokerConf, brokerMetrics)); } register(JacksonFeature.class); - registerClasses(io.swagger.jaxrs.listing.ApiListingResource.class); + registerClasses(SwaggerApiListingResource.class); registerClasses(io.swagger.jaxrs.listing.SwaggerSerializers.class); Review Comment: Not introduced in this PR, but should we use `register()` instead? Same for other places -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org