Unable to infer base url.

6,686 views
Skip to first unread message

Anand Mishra

unread,
Apr 19, 2018, 3:39:19 AM4/19/18
to Swagger
When i am running swagger-ui , i am getting a popup which shows following error:

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually: 


Screen Shot 2018-04-19 at 12.54.32 PM.png

Ron Ratovsky

unread,
May 1, 2018, 3:21:25 PM5/1/18
to swagger-sw...@googlegroups.com

That looks like a very old version of swagger-ui. Please try the latest.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
swagger-swaggers...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

Anand Mishra

unread,
May 11, 2018, 7:50:40 AM5/11/18
to Swagger

Hi Ron,

Can you please tell me which version i need to use. currently i am using the following :

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
<scope>compile</scope>
</dependency>

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

Message has been deleted

Ron Ratovsky

unread,
May 11, 2018, 9:04:09 PM5/11/18
to swagger-sw...@googlegroups.com

Springfox is not one of our projects. Please check the project’s documentation for the latest dependencies and use.

 

 

From: <swagger-sw...@googlegroups.com> on behalf of Anand Mishra <code.ana...@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Friday, May 11, 2018 at 18:42
To: Swagger <swagger-sw...@googlegroups.com>
Subject: Re: Unable to infer base url.

 

Hi Ron,

 

One more thing i have used the following code then popup remove but apis are not giving response:

 

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class WebMvcConfigure extends WebMvcConfigurItionSupport{
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
        registry.addResourceHandler("/swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
    }
}


On Thursday, April 19, 2018 at 1:09:19 PM UTC+5:30, Anand Mishra wrote:

When i am running swagger-ui , i am getting a popup which shows following error:

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually: 

--
You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages