Skip to content

Commit 27d6d38

Browse files
authored
[kotlin-server] implicitHeaders: Remove header params from API operations (#23416)
* Remove dead Swagger 2.0 annotation support (`useSwaggerAnnotations`) from Kotlin Server JAX-RS templates * Add implicit headers to AbstractKotlinCodegen * Handle implicit headers KotlinMiskServerCodegen, KotlinSpringServerCodegen and KotlinServerCodegen * Update mustache files for Kotlin Spring * Update configs and regenerate samples * Run export docs
1 parent a336a4a commit 27d6d38

File tree

40 files changed

+185
-76
lines changed

40 files changed

+185
-76
lines changed

bin/configs/kotlin-server-jaxrs-spec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/kotlin-server
66
additionalProperties:
77
useCoroutines: "true"
88
useTags: "true"
9+
implicitHeaders: "true"

bin/configs/kotlin-spring-boot-source-swagger1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
serviceImplementation: "true"
1111
serializableModel: "true"
1212
beanValidations: "true"
13+
implicitHeaders: "true"

bin/configs/kotlin-spring-boot-source-swagger2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
serviceImplementation: "true"
1111
serializableModel: "true"
1212
beanValidations: "true"
13+
implicitHeaders: "true"

docs/generators/kotlin-misk.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3232
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
3333
|generateStubImplClasses|Generate Stub Impl Classes| |false|
3434
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
35+
|implicitHeaders|Skip header parameters in the generated API methods.| |false|
3536
|modelMutable|Create mutable models| |false|
3637
|moduleClassName|Name of the generated module class| |OpenApiModule|
3738
|packageName|Generated artifact package name.| |org.openapitools|

docs/generators/kotlin-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3232
|featureResources|Generates routes in a typed way, for both: constructing URLs and reading the parameters.| |true|
3333
|fixJacksonJsonTypeInfoInheritance|When true (default), ensures Jackson polymorphism works correctly by: (1) always setting visible=true on @JsonTypeInfo, and (2) adding the discriminator property to child models with appropriate default values. When false, visible is only set to true if all children already define the discriminator property.| |true|
3434
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
35+
|implicitHeaders|Skip header parameters in the generated API methods.| |false|
3536
|interfaceOnly|Whether to generate only API interface stubs without the server files. This option is currently supported only when using jaxrs-spec library.| |false|
3637
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dt>**ktor2**</dt><dd>ktor (2.x) framework</dd><dt>**jaxrs-spec**</dt><dd>JAX-RS spec only</dd><dt>**javalin5**</dt><dd>Javalin 5</dd><dt>**javalin6**</dt><dd>Javalin 6</dd></dl>|ktor|
3738
|modelMutable|Create mutable models| |false|

docs/generators/kotlin-spring.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3636
|exceptionHandler|generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )| |true|
3737
|gradleBuildFile|generate a gradle build file using the Kotlin DSL| |true|
3838
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
39+
|implicitHeaders|Skip header parameters in the generated API methods.| |false|
3940
|includeHttpRequestContext|Whether to include HttpServletRequest (blocking) or ServerWebExchange (reactive) as additional parameter in generated methods.| |false|
4041
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
4142
|library|library template (sub-template)|<dl><dt>**spring-boot**</dt><dd>Spring-boot Server application.</dd><dt>**spring-cloud**</dt><dd>Spring-Cloud-Feign client with Spring-Boot auto-configured settings.</dd><dt>**spring-declarative-http-interface**</dt><dd>Spring Declarative Interface client</dd></dl>|spring-boot|

docs/generators/kotlin-vertx.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2424
|artifactVersion|Generated artifact's package version.| |1.0.0|
2525
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
2626
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
27+
|implicitHeaders|Skip header parameters in the generated API methods.| |false|
2728
|modelMutable|Create mutable models| |false|
2829
|packageName|Generated artifact package name.| |org.openapitools|
2930
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|

docs/generators/kotlin-wiremock.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2424
|artifactVersion|Generated artifact's package version.| |1.0.0|
2525
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
2626
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
27+
|implicitHeaders|Skip header parameters in the generated API methods.| |false|
2728
|modelMutable|Create mutable models| |false|
2829
|packageName|Generated artifact package name.| |org.openapitools|
2930
|parcelizeModels|toggle &quot;@Parcelize&quot; for generated models| |null|

docs/generators/kotlin.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3232
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
3333
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
3434
|idea|Add IntelliJ Idea plugin and mark Kotlin main and test folders as source folders.| |false|
35+
|implicitHeaders|Skip header parameters in the generated API methods.| |false|
3536
|library|Library template (sub-template) to use|<dl><dt>**jvm-ktor**</dt><dd>Platform: Java Virtual Machine. HTTP client: Ktor 1.6.7. JSON processing: Gson, Jackson (default).</dd><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-spring-webclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 5 (or 6 with useSpringBoot3 enabled) WebClient. JSON processing: Jackson.</dd><dt>**jvm-spring-restclient**</dt><dd>Platform: Java Virtual Machine. HTTP: Spring 6 RestClient. JSON processing: Jackson.</dd><dt>**jvm-retrofit2**</dt><dd>Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.7. JSON processing: Kotlinx Serialization: 1.2.1.</dd><dt>**jvm-volley**</dt><dd>Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9 (Deprecated)</dd><dt>**jvm-vertx**</dt><dd>Platform: Java Virtual Machine. HTTP client: Vert.x Web Client. JSON processing: Moshi, Gson or Jackson.</dd></dl>|jvm-okhttp4|
3637
|mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)| |false|
3738
|modelMutable|Create mutable models| |false|

docs/generators/ktorm-schema.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2626
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
2727
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
2828
|identifierNamingConvention|Naming convention of Ktorm identifiers(table names and column names). This is not related to database name which is defined by defaultDatabaseName option|<dl><dt>**original**</dt><dd>Do not transform original names</dd><dt>**snake_case**</dt><dd>Use snake_case names</dd></dl>|original|
29+
|implicitHeaders|Skip header parameters in the generated API methods.| |false|
2930
|importModelPackageName|Package name of the imported models| |org.openapitools.database.models|
3031
|modelMutable|Create mutable models| |false|
3132
|packageName|Generated artifact package name.| |org.openapitools.database|

0 commit comments

Comments
 (0)