Can't find Swagger UI endpoint
See original GitHub issuePlease take the time to search the repository, if your question has already been asked or answered.
- What version of the library are you using? 2.8.0 With spring boot.
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
What kind of issue is this?
- Question. Is this a question about how to do a certain thing?
Hello,
I’m sure this is a stupid question but I’ve followed the steps on http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api to get the swagger / swagger ui to work.
My docket config looks as follows:
@Bean
public Docket mainConfig() {
return new Docket(DocumentationType.SWAGGER_2)
.select().apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping("/swagger")
.directModelSubstitute(LocalDate.class, String.class)
.genericModelSubstitutes(ResponseEntity.class);
}
With this I can go to /v2/api-docs
to see the json version. However I can’t find the UI endpoint.
When going to http://localhost:8080/swagger-resources/
I only see:
[
{
"name": "default",
"url": "/v2/api-docs",
"swaggerVersion": "2.0",
"location": "/v2/api-docs"
}
]
I’ve tried:
- http://localhost:8080/swagger-ui.html
- http://localhost:8080/v2/api/swagger-ui.html
- http://localhost:8080/swagger-resources/swagger-ui.html
- http://localhost:8080/api/swagger-ui.html
To no avail.
Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:69 (16 by maintainers)
Top Results From Across the Web
Cannot get my endpoints list from controller in swagger UI
I'm just trying to configure my Rest controller endpoints to show on swagger UI screen but it shows No operations for specs defined....
Read more >Installation - Swagger Documentation
The module's contents mirror the dist folder you see in the Git repository. The most useful file is swagger-ui-bundle.js , which is a...
Read more >Setting Up Swagger 2 with a Spring REST API - Baeldung
Learn how to document a Spring REST API using Swagger 2. ... which provides a way to control the endpoints exposed by Swagger....
Read more >Get started with Swashbuckle and ASP.NET Core
The generated document describing the endpoints appears as shown in OpenAPI specification (openapi.json). The Swagger UI can be found at https ...
Read more >Configuring and Using Swagger UI in ASP.NET Core Web API
We are going to learn how to integrate the Swagger UI/OpenAPI in an ASP.NET Core Web API, ... we can test the endpoint...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have encountered this problem before and the problem was in the below line in application.properties spring.resources.add-mappings=false
remove it or change it’s value to true
Hello @nWidart,
I was facing the same issue, but I’ve figured out what was happening in my case…
Although I see you have fixed the problem already, for those whom this suggestion hasn’t worked, if you’re using @EnableMvc in any java config file, remove it. I’ve not quite believed at the beginning, but it has worked.
Give it a try…
Regards,
Luciano Daher.