-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
65 lines (56 loc) · 2.13 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
59
60
61
62
63
64
65
plugins {
id 'java'
alias(libs.plugins.spring.boot)
alias(libs.plugins.spring.dependency.management)
alias(libs.plugins.openapi.generator)
}
dependencies {
implementation project(':examples:examples-common')
implementation project(':spring-boot-starter:spring-boot-starter-web')
implementation('org.springframework.boot:spring-boot-starter-web') {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
exclude group: 'io.undertow', module: 'undertow-websockets-jsr'
}
implementation 'org.springframework.boot:spring-boot-starter-undertow'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.hibernate.validator:hibernate-validator'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation(libs.openapi.tools.jacksonDatabindNullable)
implementation(libs.jakarta.validation.api)
implementation(libs.swagger.annotations)
}
test {
useJUnitPlatform()
}
def generatedSourceDirectory = "$buildDir/generated"
sourceSets {
main {
java {
srcDir generatedSourceDirectory + '/src/main/java'
}
}
}
openApiValidate {
inputSpec = "$projectDir/src/main/resources/openapi.yaml"
recommend = true
}
openApiGenerate {
generatorName = "spring"
inputSpec = "$projectDir/src/main/resources/openapi.yaml"
outputDir = generatedSourceDirectory
apiPackage = "com.getyourguide.openapi.validation.example.openapi"
invokerPackage = "com.getyourguide.openapi.validation.example.openapi"
modelPackage = "com.getyourguide.openapi.validation.example.openapi.model"
configOptions = [
useSpringBoot3 : "true",
dateLibrary : "java8",
performBeanValidation : "true",
hideGenerationTimestamp: "true",
serializableModel : "true",
interfaceOnly : "true",
skipDefaultInterface : "true",
useTags : "true"
]
}
tasks.openApiGenerate.dependsOn tasks.openApiValidate
tasks.compileJava.dependsOn tasks.openApiGenerate