forked from loafle/openapi-generator-original
Co-authored-by: Steven <steven.goris@nike.com>
This commit is contained in:
parent
ff48f80379
commit
0b41ee1c78
@ -96,14 +96,14 @@ This gives access to the following tasks:
|
|||||||
|
|
||||||
> The plugin implements the above tasks as project extensions of the same name. If you’d like to declare these tasks as dependencies to other tasks (using `dependsOn`), you’ll need a task reference. e.g.:
|
> The plugin implements the above tasks as project extensions of the same name. If you’d like to declare these tasks as dependencies to other tasks (using `dependsOn`), you’ll need a task reference. e.g.:
|
||||||
> ```groovy
|
> ```groovy
|
||||||
> compileJava.dependsOn tasks.openApiGenerate
|
> compileJava.dependsOn tasks.named("openApiGenerate")
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
For full details of all options, see the [plugin README](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin).
|
For full details of all options, see the [plugin README](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin).
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
An example task for generating a kotlin client:
|
An example openApiGenerate task configuration for generating a kotlin client:
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
openApiGenerate {
|
openApiGenerate {
|
||||||
@ -113,8 +113,10 @@ openApiGenerate {
|
|||||||
apiPackage = "org.openapi.example.api"
|
apiPackage = "org.openapi.example.api"
|
||||||
invokerPackage = "org.openapi.example.invoker"
|
invokerPackage = "org.openapi.example.invoker"
|
||||||
modelPackage = "org.openapi.example.model"
|
modelPackage = "org.openapi.example.model"
|
||||||
configOptions = [
|
configOptions.putAll([
|
||||||
dateLibrary: "java8"
|
dateLibrary: "java8"
|
||||||
]
|
])
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
*If you want to create separate tasks (for example when you have more than one api spec and require different parameters for each), this is how to do so in Gradle 7+: `tasks.register('taskName', org.openapitools.generator.gradle.plugin.tasks.GenerateTask) { ... }`.*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user