jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.47k stars 4.02k forks source link

Swagger UI Not Displaying APIs in Gateway Application #25588

Closed EhsanMo closed 5 months ago

EhsanMo commented 6 months ago
Overview of the issue

After generating a gateway application with JHipster v8.x,(8.0, 8.1 or 8.2.1) the Swagger UI (swagger-ui/index.html) does not show any APIs, including its own or those from other microservices. This issue results in the absence of central Swagger documentation for the gateway and associated microservices.

Motivation for or Use Case

Having a central Swagger UI is crucial for testing and documenting the APIs available through the gateway. This bug affects the ability to visually interact with and document the API endpoints provided by the gateway and its connected microservices.

Reproduce the error

Steps to generate the gateway application which leads to the mentioned problem:

Run JHipster generator and select the following options:

Application base name: jhispterv821 Application type: Gateway application Server port: 8080 Java package name: org.sohagroup.test.gateway Service discovery server: JHipster Registry (Eureka, Spring Cloud Config support) Authentication type: OAuth 2.0 / OIDC Authentication Database type: No database Cache: No cache Build tool: Maven Client framework: React Enable microfrontends: Yes Admin UI: Yes Bootswatch theme: Default JHipster Internationalization support: Yes, with English as the native language

-Upon building and running (with profiles dev, api-docs and webapp) the application and navigating to swagger-ui/index.html, no APIs are listed in the Swagger UI.

Related issues
Suggest a Fix
JHipster Version(s)

8.0.0, 8.1, 8.2.1

Environment and Tools

Welcome to JHipster v8.2.1

Welcome to the JHipster Information Sub-Generator

jhispterv-821@0.0.1-SNAPSHOT /Users/feynman/Developer/exprimental/jhispterv8.2.1
└── generator-jhipster@8.2.1
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "gateway",
    "authenticationType": "oauth2",
    "baseName": "jhispterv821",
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "react",
    "clientTestFrameworks": [],
    "clientTheme": "none",
    "creationTimestamp": 1711017619790,
    "databaseType": "no",
    "devDatabaseType": "no",
    "devServerPort": 9060,
    "enableGradleEnterprise": null,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [],
    "feignClient": null,
    "gradleEnterpriseHost": null,
    "jhipsterVersion": "8.2.1",
    "languages": [
      "en",
      "fa"
    ],
    "messageBroker": false,
    "microfrontend": true,
    "microfrontends": [],
    "nativeLanguage": "en",
    "packageName": "org.sohagroup.test.gateway",
    "prodDatabaseType": "no",
    "reactive": true,
    "searchEngine": false,
    "serverPort": 8080,
    "serverSideOptions": [],
    "serviceDiscoveryType": "eureka",
    "skipUserManagement": true,
    "syncUserWithIdp": null,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
Environment and Tools

openjdk version "17.0.5" 2022-10-18 LTS OpenJDK Runtime Environment GraalVM 22.3.0 (build 17.0.5+8-LTS) OpenJDK 64-Bit Server VM GraalVM 22.3.0 (build 17.0.5+8-LTS, mixed mode, sharing)

git version 2.42.0

node: v20.9.0 npm: 10.1.0

Docker version 24.0.6, build ed223bc

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Browsers and Operating System

OS: macOS The issue is not browser-specific as it pertains to the server-side generation of Swagger documentation.

mshima commented 6 months ago

Please post jhipster info in the issue description.

EhsanMo commented 6 months ago

I've added it.

github-actions[bot] commented 6 months ago

JHipster has completed the sample check .yo-rc.json: valid Entities JDL: blank Application: successfully generated Frontend check: success Backend check: success E2E check: success

This check uses jhipster info output from the issue description to generate the sample. Bug report that does not contain this information will be marked as invalid.

mshima commented 5 months ago

I've tried using main + jit:

jhipster from-issue 25588
cd issues/25588
npm install
npm run services:up
./mvnw

npm run watch instead ./mvnw works as well.