OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
22.03k stars 6.61k forks source link

[REQ] Improve documentation for Gradle 8.0.2 #15095

Open GoGoris opened 1 year ago

GoGoris commented 1 year ago

Is your feature request related to a problem? Please describe.

The Gradle documentation is outdated for Gradle 8.

Describe the solution you'd like

Update the documentation to use the lazy tasks.register api instead of the deprecated methods.

def generateModelsTask = tasks.register('generateModels', GenerateTask) {
    generatorName = "java"
    inputSpec = "<inputSpec>"
    outputDir = "<outputDir>"
    modelPackage = "<package>"
    generateModelTests = false
    globalProperties.putAll([
            // force only the models
            apis    : "false",
            invokers: "false",
    ])
    configOptions.putAll([
            library             : "native",
            serializationLibrary: "jackson",
            dateLibrary         : "java8",
            useJakartaEe        : "true",
    ])
}

compileJava.dependsOn generateModelsTask

Describe alternatives you've considered

/

Additional context

https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:defining_tasks

wing328 commented 1 year ago

can you please file a PR to update the readme?

GoGoris commented 1 year ago

Hi @wing328, I will submit a PR this week when I have some time.