代码之家  ›  专栏  ›  技术社区  ›  Sanal M

swagger ui不适用于没有客户端的jhipster应用程序

  •  0
  • Sanal M  · 技术社区  · 2 年前

    我创建了一个jhipster应用程序,它现在有了客户端。初始配置是以下给出的选项,

    ? Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
    ? What is the base name of your application? nouisample
    ? Do you want to make it reactive with Spring WebFlux? No
    ? What is your default Java package name? com.mycompany.myapp
    ? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
    ? Which *type* of database would you like to use? SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL)
    ? Which *production* database would you like to use? MySQL
    ? Which *development* database would you like to use? MySQL
    ? Which cache do you want to use? (Spring cache abstraction) No cache - Warning, when using an SQL database, this will
    disable the Hibernate 2nd level cache!
    ? Would you like to use Maven or Gradle for building the backend? Maven
    ? Do you want to use the JHipster Registry to configure, monitor and scale your application? No
    ? Which other technologies would you like to use? API first development using OpenAPI-generator
    ? Which *Framework* would you like to use for the client? No client
    ? Would you like to enable internationalization support? No
    ? Please choose the native language of the application English
    ? Besides JUnit and Jest, which testing frameworks would you like to use?
    ? Would you like to install other generators from the JHipster Marketplace? No
    

    我在以下配置文件中启动应用程序,

    2023-06-18T15:15:58.305+05:30  INFO 23300 --- [  restartedMain] com.mycompany.myapp.NouisampleApp        : The following 2 profiles are active: "dev", "api-docs"
    

    中的应用程序启动器http://localhost:8080/”。

    但我无法连接招摇ui。我尝试了以下网址,

    1. http://localhost:8080/#/docs
    2. http://localhost:8080/swagger-ui.html
    3. http://127.0.0.1:8761/swagger-ui/index.html

    我得到的只是一个包含以下文本的错误页面。

    Your request cannot be processed
    Sorry, an error has occurred.
    
    Status: Not Found (Not Found)
    Message: Not Found
    

    有人能帮忙吗?如何访问swagger ui?

    0 回复  |  直到 2 年前
        1
  •  1
  •   Javier Vargas    1 年前

    正如@Matt Raible所说,你看不到Swagger UI,因为你没有任何客户端,作为一种可能的解决方案,你可以访问 http://localhost:8080/v3/api-docs http://localhost:8080/v3/api-docs.yaml 在这里,您可以下载一个yaml以在poster或类似程序中导入。这至少适用于jhipster 7.9.4,但我认为它至少适用于7.5.x。

    希望这能有所帮助。