[kotlin] Make API classes open (non-final) unless nonPublicApi is used (#22461)

* [kotlin] Make API classes open (non-final) unless nonPublicApi is used

By making those classes open, AspectJ can be used to enhance their
behavior.

I'm not changing kotlin-multiplatform templates, where 'open' was
already present before my changes.

Closes #22271

* Fail Kotlin sample compilation if API classes stop to be public

Serves as a 'regression test'.
This commit is contained in:
Piotr Kubowicz
2025-11-30 17:03:29 +01:00
committed by GitHub
parent 453997bd16
commit 7b83462a83
101 changed files with 107 additions and 100 deletions

View File

@@ -28,7 +28,7 @@ import org.springframework.util.LinkedMultiValueMap
import org.openapitools.client.infrastructure.*
class AuthApi(client: WebClient) : ApiClient(client) {
open class AuthApi(client: WebClient) : ApiClient(client) {
constructor(baseUrl: String) : this(WebClient.builder()
.baseUrl(baseUrl)

View File

@@ -30,7 +30,7 @@ import org.openapitools.client.models.Pet
import org.openapitools.client.models.Tag
import org.openapitools.client.infrastructure.*
class BodyApi(client: WebClient) : ApiClient(client) {
open class BodyApi(client: WebClient) : ApiClient(client) {
constructor(baseUrl: String) : this(WebClient.builder()
.baseUrl(baseUrl)

View File

@@ -28,7 +28,7 @@ import org.springframework.util.LinkedMultiValueMap
import org.openapitools.client.infrastructure.*
class FormApi(client: WebClient) : ApiClient(client) {
open class FormApi(client: WebClient) : ApiClient(client) {
constructor(baseUrl: String) : this(WebClient.builder()
.baseUrl(baseUrl)

View File

@@ -29,7 +29,7 @@ import org.springframework.util.LinkedMultiValueMap
import org.openapitools.client.models.StringEnumRef
import org.openapitools.client.infrastructure.*
class HeaderApi(client: WebClient) : ApiClient(client) {
open class HeaderApi(client: WebClient) : ApiClient(client) {
constructor(baseUrl: String) : this(WebClient.builder()
.baseUrl(baseUrl)

View File

@@ -29,7 +29,7 @@ import org.springframework.util.LinkedMultiValueMap
import org.openapitools.client.models.StringEnumRef
import org.openapitools.client.infrastructure.*
class PathApi(client: WebClient) : ApiClient(client) {
open class PathApi(client: WebClient) : ApiClient(client) {
constructor(baseUrl: String) : this(WebClient.builder()
.baseUrl(baseUrl)

View File

@@ -31,7 +31,7 @@ import org.openapitools.client.models.StringEnumRef
import org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
import org.openapitools.client.infrastructure.*
class QueryApi(client: WebClient) : ApiClient(client) {
open class QueryApi(client: WebClient) : ApiClient(client) {
constructor(baseUrl: String) : this(WebClient.builder()
.baseUrl(baseUrl)