问题描述
当我手动生成 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 *
}
解决方法
感谢@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
}
}