2

When I generate a JHipster application manually, I get asked whether I want to to go with a 'API first'-approach (e.g.: Which other technologies would you like to use? > API first development using OpenAPI-generator)

How can I do the same if want to create the application with a JDL-file? e.g.:

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 *
}
domi
  • 2,167
  • 1
  • 28
  • 45
  • 1
    I'm not sure it is covered. Have you tried to generate a project with openapi using questions and then run `jhipster export-jdl`? – Gaël Marziou Mar 21 '21 at 17:31

1 Answers1

4

thanks to @gaël-marziou I found it: 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
  }
}
domi
  • 2,167
  • 1
  • 28
  • 45
  • 2
    In fact, it was documented :) at https://www.jhipster.tech/jdl/applications#options-in-applications although there's no comment for it, I will submit a PR – Gaël Marziou Mar 22 '21 at 10:22