File tree Expand file tree Collapse file tree 2 files changed +487
-1
lines changed
src/main/resources/kodeverk Expand file tree Collapse file tree 2 files changed +487
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ plugins {
24
24
id(" org.jetbrains.kotlin.plugin.serialization" ) version " 2.2.0"
25
25
id(" com.gradleup.shadow" ) version " 8.3.8"
26
26
id(" com.expediagroup.graphql" ) version " 8.8.1"
27
+ id(" org.openapi.generator" ) version " 7.15.0"
27
28
}
28
29
29
30
group = " no.nav"
@@ -95,6 +96,14 @@ dependencies {
95
96
testImplementation(" org.junit.jupiter:junit-jupiter:$junit_version " )
96
97
}
97
98
99
+ sourceSets {
100
+ main {
101
+ kotlin {
102
+ srcDir(" ${project.layout.buildDirectory} /generated/source/openapi/src/main/kotlin" )
103
+ }
104
+ }
105
+ }
106
+
98
107
tasks.withType<Test > {
99
108
useJUnitPlatform()
100
109
@@ -161,8 +170,25 @@ val generatePDLClient by tasks.creating(GraphQLGenerateClientTask::class) {
161
170
dependsOn(" downloadPDLSchema" )
162
171
}
163
172
173
+
174
+
175
+ openApiGenerate {
176
+ inputSpec.set(" ${project.projectDir} /src/main/resources/kodeverk/openapi.json" )
177
+ generatorName.set(" kotlin" )
178
+ packageName.set(" no.nav.modiarobotapi.generated.kodeverk" )
179
+ configOptions.set(mapOf (
180
+ " serializationLibrary" to " kotlinx_serialization" ,
181
+ " library" to " jvm-ktor"
182
+ ))
183
+ }
184
+
164
185
tasks {
186
+ register(" generateApi" ) {
187
+ group = " build"
188
+ description = " Generate API"
189
+ dependsOn(" openApiGenerate" )
190
+ }
165
191
processResources {
166
- dependsOn(" generatePDLClient" )
192
+ dependsOn(" generateApi " , " generatePDLClient" )
167
193
}
168
194
}
You can’t perform that action at this time.
0 commit comments