Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't access API's documentation with JHipster

I've been trying to access the generated Swagger-UI of a JHipster generated Spring app. I've tried to access through "/swagger-ui.html" as that worked out just fine with other projects, but not this time. I've also looked up the security configuration class and tried all URLs that reference swagger (like "/swagger-ui/index.html") but none of them work: It's response code 404.

I know that the configuration class gets run, because the console shows the "Started Swagger" message, but still no UI.

Any ideas? Any help will be much appreciated. Thanks.

like image 474
Unai P. Mendizabal Avatar asked Nov 13 '16 14:11

Unai P. Mendizabal


People also ask

How do I view API documents?

To access all API documentation, navigate to our Data & Insights Developer site and click on API Docs in the top header. We also support a number of programmatic data publishing solutions used to import data to the Data & Insights platform.

How do I access swagger UI in JHipster?

To access the Swagger docs on a JHipster app, you need to go login as an admin and click the "API" link in the admin navbar dropdown.

What is Gateway application in JHipster?

A gateway is a normal JHipster application, so you can use the usual JHipster options and development workflows on that project, but it also acts as the entrance to your microservices.

What is JHipster registry?

The JHipster Registry is a runtime application, provided by the JHipster team. Like the JHipster generator, it is an Open Source, Apache 2-licensed application, and its source code is available on GitHub under the JHipster organization at jhipster/jhipster-registry.


2 Answers

To access the Swagger docs on a JHipster app, you need to go login as an admin and click the "API" link in the admin navbar dropdown.

You can also access it directly at http://localhost:8080/#/docs

like image 63
Jon Ruddell Avatar answered Oct 16 '22 19:10

Jon Ruddell


Have you made sure that the swagger profile is active? Check your config at src/main/resources/config/application-dev.yml

spring:
    profiles:
        active: dev
        include: swagger

or

spring:
    profiles:
        active: dev, swagger
like image 2
Tom Nijs Avatar answered Oct 16 '22 17:10

Tom Nijs