-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
58 lines (52 loc) · 1.51 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
plugins {
id 'org.springframework.boot' version '2.7.0'
id 'org.openapi.generator' version '6.0.0'
//id 'org.openapi.generator' version '5.3.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// generator 6.x
implementation 'io.swagger.core.v3:swagger-annotations:2.2.0'
// generator 5.x
//implementation 'io.swagger:swagger-annotations:1.6.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
openApiGenerate {
inputSpec = "$rootDir/openapi.yaml"
generatorName = "spring"
validateSpec = true
apiPackage = "com.example.demo.api"
modelPackage = "com.example.demo.api.model"
outputDir = "$buildDir/generated-sources"
library = "spring-boot"
configOptions = [
"interfaceOnly": "true"
]
globalProperties = [
"skipFormModel": "false"
]
}
sourceSets {
main {
java {
srcDir "$buildDir/generated-sources/src/main/java"
}
}
}
tasks.withType(JavaCompile) {
dependsOn(tasks.openApiGenerate)
}
tasks.named('test') {
useJUnitPlatform()
}