1

当我手动生成 JHipster 应用程序时,我被问到是否要采用“API 优先”方法(例如:您还想使用哪些其他技术?> 使用 OpenAPI 生成器进行 API 优先开发)

如果想使用 JDL 文件创建应用程序,我该怎么做?例如:

application {
  config {
    baseName myapp
    applicationType monolith
    devDatabaseType mysql
    prodDatabaseType mysql
    buildTool maven
    clientFramework react
    enableTranslation true
    nativeLanguage en
    languages [en, de]
    enableOpenApi true <-- What is the correct way to enable OpenAPI?
  }
  entities *
}
4

1 回答 1

3

感谢@gaël-marziou 我找到了它:enableSwaggerCodegen true

jhipster export-jdl export.jh
cat export.jh

application {
  config {
    applicationType monolith
    authenticationType jwt
    baseName dummy
    blueprints []
    buildTool maven
    cacheProvider no
    clientFramework angularX
    clientPackageManager npm
    clientTheme flatly
    clientThemeVariant dark
    creationTimestamp 1616332818045
    databaseType sql
    devDatabaseType postgresql
    dtoSuffix DTO
    enableHibernateCache false
    enableSwaggerCodegen true <-- this is it
    enableTranslation true
    jhiPrefix jhi
    jhipsterVersion "7.0.0"
    jwtSecretKey "xxxxxxx"
    languages [en]
    messageBroker false
    nativeLanguage en
    otherModules []
    packageName com.mycompany.myapp
    prodDatabaseType postgresql
    reactive false
    searchEngine false
    serverPort 8080
    serviceDiscoveryType eureka
    skipClient false
    skipServer false
    skipUserManagement false
    testFrameworks []
    websocket false
    withAdminUi true
  }
}
于 2021-03-21T21:09:12.977 回答