@goast/kotlin 0.5.10 → 0.5.11-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/LICENSE +21 -21
  2. package/assets/client/okhttp3/ApiAbstractions.kt +30 -30
  3. package/assets/client/okhttp3/ApiClient.kt +252 -252
  4. package/assets/client/okhttp3/ApiResponse.kt +43 -43
  5. package/assets/client/okhttp3/Errors.kt +21 -21
  6. package/assets/client/okhttp3/PartConfig.kt +11 -11
  7. package/assets/client/okhttp3/RequestConfig.kt +18 -18
  8. package/assets/client/okhttp3/RequestMethod.kt +8 -8
  9. package/assets/client/okhttp3/ResponseExtensions.kt +24 -24
  10. package/assets/client/spring-reactive-web-clients/ApiRequestFile.kt +33 -33
  11. package/esm/src/ast/references/spring-reactive.d.ts +1 -0
  12. package/esm/src/ast/references/spring-reactive.d.ts.map +1 -1
  13. package/esm/src/ast/references/spring-reactive.js +1 -0
  14. package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +28 -28
  15. package/esm/src/generators/services/okhttp3-clients/okhttp3-clients-generator.js +9 -9
  16. package/esm/src/generators/services/spring-controllers/spring-controller-generator.js +9 -9
  17. package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts.map +1 -1
  18. package/esm/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.js +3 -6
  19. package/package.json +1 -1
  20. package/script/src/ast/references/spring-reactive.d.ts +1 -0
  21. package/script/src/ast/references/spring-reactive.d.ts.map +1 -1
  22. package/script/src/ast/references/spring-reactive.js +2 -1
  23. package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +28 -28
  24. package/script/src/generators/services/okhttp3-clients/okhttp3-clients-generator.js +9 -9
  25. package/script/src/generators/services/spring-controllers/spring-controller-generator.js +9 -9
  26. package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.d.ts.map +1 -1
  27. package/script/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.js +3 -6
  28. package/src/mod.ts +0 -8
  29. package/src/src/assets.ts +0 -9
  30. package/src/src/ast/_index.ts +0 -66
  31. package/src/src/ast/common.ts +0 -1
  32. package/src/src/ast/index.ts +0 -1
  33. package/src/src/ast/node.ts +0 -10
  34. package/src/src/ast/nodes/annotation.ts +0 -79
  35. package/src/src/ast/nodes/argument.ts +0 -62
  36. package/src/src/ast/nodes/call.ts +0 -75
  37. package/src/src/ast/nodes/class.ts +0 -178
  38. package/src/src/ast/nodes/collection-literal.ts +0 -49
  39. package/src/src/ast/nodes/constructor.ts +0 -126
  40. package/src/src/ast/nodes/doc-tag.ts +0 -138
  41. package/src/src/ast/nodes/doc.ts +0 -111
  42. package/src/src/ast/nodes/enum-value.ts +0 -100
  43. package/src/src/ast/nodes/enum.ts +0 -163
  44. package/src/src/ast/nodes/function.ts +0 -178
  45. package/src/src/ast/nodes/generic-parameter.ts +0 -54
  46. package/src/src/ast/nodes/init-block.ts +0 -38
  47. package/src/src/ast/nodes/interface.ts +0 -133
  48. package/src/src/ast/nodes/lambda-type.ts +0 -73
  49. package/src/src/ast/nodes/lambda.ts +0 -74
  50. package/src/src/ast/nodes/object.ts +0 -102
  51. package/src/src/ast/nodes/parameter.ts +0 -118
  52. package/src/src/ast/nodes/property.ts +0 -225
  53. package/src/src/ast/nodes/reference.ts +0 -178
  54. package/src/src/ast/nodes/string.ts +0 -114
  55. package/src/src/ast/nodes/types.ts +0 -23
  56. package/src/src/ast/references/index.ts +0 -10
  57. package/src/src/ast/references/jackson.ts +0 -59
  58. package/src/src/ast/references/jakarta.ts +0 -14
  59. package/src/src/ast/references/java.ts +0 -27
  60. package/src/src/ast/references/kotlin.ts +0 -41
  61. package/src/src/ast/references/kotlinx.ts +0 -14
  62. package/src/src/ast/references/okhttp3.ts +0 -5
  63. package/src/src/ast/references/reactor.ts +0 -5
  64. package/src/src/ast/references/spring-reactive.ts +0 -33
  65. package/src/src/ast/references/spring.ts +0 -86
  66. package/src/src/ast/references/swagger.ts +0 -23
  67. package/src/src/ast/utils/get-kotlin-builder-options.ts +0 -19
  68. package/src/src/ast/utils/to-kt-node.ts +0 -31
  69. package/src/src/ast/utils/write-kt-annotations.ts +0 -15
  70. package/src/src/ast/utils/write-kt-arguments.ts +0 -45
  71. package/src/src/ast/utils/write-kt-enum-values.ts +0 -27
  72. package/src/src/ast/utils/write-kt-generic-parameters.ts +0 -12
  73. package/src/src/ast/utils/write-kt-members.ts +0 -25
  74. package/src/src/ast/utils/write-kt-node.ts +0 -37
  75. package/src/src/ast/utils/write-kt-parameters.ts +0 -25
  76. package/src/src/common-results.ts +0 -4
  77. package/src/src/config.ts +0 -61
  78. package/src/src/file-builder.ts +0 -112
  79. package/src/src/generators/file-generator.ts +0 -29
  80. package/src/src/generators/index.ts +0 -5
  81. package/src/src/generators/models/args.ts +0 -136
  82. package/src/src/generators/models/index.ts +0 -4
  83. package/src/src/generators/models/model-generator.ts +0 -725
  84. package/src/src/generators/models/models-generator.ts +0 -65
  85. package/src/src/generators/models/models.ts +0 -95
  86. package/src/src/generators/services/okhttp3-clients/args.ts +0 -90
  87. package/src/src/generators/services/okhttp3-clients/index.ts +0 -4
  88. package/src/src/generators/services/okhttp3-clients/models.ts +0 -73
  89. package/src/src/generators/services/okhttp3-clients/okhttp3-client-generator.ts +0 -613
  90. package/src/src/generators/services/okhttp3-clients/okhttp3-clients-generator.ts +0 -188
  91. package/src/src/generators/services/okhttp3-clients/refs.ts +0 -59
  92. package/src/src/generators/services/spring-controllers/args.ts +0 -95
  93. package/src/src/generators/services/spring-controllers/index.ts +0 -4
  94. package/src/src/generators/services/spring-controllers/models.ts +0 -76
  95. package/src/src/generators/services/spring-controllers/refs.ts +0 -17
  96. package/src/src/generators/services/spring-controllers/spring-controller-generator.ts +0 -1109
  97. package/src/src/generators/services/spring-controllers/spring-controllers-generator.ts +0 -140
  98. package/src/src/generators/services/spring-reactive-web-clients/args.ts +0 -103
  99. package/src/src/generators/services/spring-reactive-web-clients/index.ts +0 -4
  100. package/src/src/generators/services/spring-reactive-web-clients/models.ts +0 -62
  101. package/src/src/generators/services/spring-reactive-web-clients/refs.ts +0 -11
  102. package/src/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.ts +0 -586
  103. package/src/src/generators/services/spring-reactive-web-clients/spring-reactive-web-clients-generator.ts +0 -125
  104. package/src/src/import-collection.ts +0 -98
  105. package/src/src/types.ts +0 -3
  106. package/src/src/utils.ts +0 -47
@@ -1,43 +1,43 @@
1
- package @PACKAGE_NAME@
2
-
3
- enum class ResponseType {
4
- Success, Informational, Redirection, ClientError, ServerError
5
- }
6
-
7
- interface Response
8
-
9
- abstract class ApiResponse<T>(val responseType: ResponseType) : Response {
10
- abstract val statusCode: Int
11
- abstract val headers: Map<String, List<String>>
12
- }
13
-
14
- class Success<T>(
15
- val data: T,
16
- override val statusCode: Int = -1,
17
- override val headers: Map<String, List<String>> = mapOf()
18
- ) : ApiResponse<T>(ResponseType.Success)
19
-
20
- class Informational<T>(
21
- val statusText: String,
22
- override val statusCode: Int = -1,
23
- override val headers: Map<String, List<String>> = mapOf()
24
- ) : ApiResponse<T>(ResponseType.Informational)
25
-
26
- class Redirection<T>(
27
- override val statusCode: Int = -1,
28
- override val headers: Map<String, List<String>> = mapOf()
29
- ) : ApiResponse<T>(ResponseType.Redirection)
30
-
31
- class ClientError<T>(
32
- val message: String? = null,
33
- val body: Any? = null,
34
- override val statusCode: Int = -1,
35
- override val headers: Map<String, List<String>> = mapOf()
36
- ) : ApiResponse<T>(ResponseType.ClientError)
37
-
38
- class ServerError<T>(
39
- val message: String? = null,
40
- val body: Any? = null,
41
- override val statusCode: Int = -1,
42
- override val headers: Map<String, List<String>>
43
- ) : ApiResponse<T>(ResponseType.ServerError)
1
+ package @PACKAGE_NAME@
2
+
3
+ enum class ResponseType {
4
+ Success, Informational, Redirection, ClientError, ServerError
5
+ }
6
+
7
+ interface Response
8
+
9
+ abstract class ApiResponse<T>(val responseType: ResponseType) : Response {
10
+ abstract val statusCode: Int
11
+ abstract val headers: Map<String, List<String>>
12
+ }
13
+
14
+ class Success<T>(
15
+ val data: T,
16
+ override val statusCode: Int = -1,
17
+ override val headers: Map<String, List<String>> = mapOf()
18
+ ) : ApiResponse<T>(ResponseType.Success)
19
+
20
+ class Informational<T>(
21
+ val statusText: String,
22
+ override val statusCode: Int = -1,
23
+ override val headers: Map<String, List<String>> = mapOf()
24
+ ) : ApiResponse<T>(ResponseType.Informational)
25
+
26
+ class Redirection<T>(
27
+ override val statusCode: Int = -1,
28
+ override val headers: Map<String, List<String>> = mapOf()
29
+ ) : ApiResponse<T>(ResponseType.Redirection)
30
+
31
+ class ClientError<T>(
32
+ val message: String? = null,
33
+ val body: Any? = null,
34
+ override val statusCode: Int = -1,
35
+ override val headers: Map<String, List<String>> = mapOf()
36
+ ) : ApiResponse<T>(ResponseType.ClientError)
37
+
38
+ class ServerError<T>(
39
+ val message: String? = null,
40
+ val body: Any? = null,
41
+ override val statusCode: Int = -1,
42
+ override val headers: Map<String, List<String>>
43
+ ) : ApiResponse<T>(ResponseType.ServerError)
@@ -1,21 +1,21 @@
1
- @file:Suppress("unused")
2
-
3
- package @PACKAGE_NAME@
4
-
5
- import java.lang.RuntimeException
6
-
7
- open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) :
8
- RuntimeException(message) {
9
-
10
- companion object {
11
- private const val serialVersionUID: Long = 123L
12
- }
13
- }
14
-
15
- open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) :
16
- RuntimeException(message) {
17
-
18
- companion object {
19
- private const val serialVersionUID: Long = 456L
20
- }
21
- }
1
+ @file:Suppress("unused")
2
+
3
+ package @PACKAGE_NAME@
4
+
5
+ import java.lang.RuntimeException
6
+
7
+ open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) :
8
+ RuntimeException(message) {
9
+
10
+ companion object {
11
+ private const val serialVersionUID: Long = 123L
12
+ }
13
+ }
14
+
15
+ open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) :
16
+ RuntimeException(message) {
17
+
18
+ companion object {
19
+ private const val serialVersionUID: Long = 456L
20
+ }
21
+ }
@@ -1,11 +1,11 @@
1
- package @PACKAGE_NAME@
2
-
3
- /**
4
- * Defines a config object for a given part of a multi-part request.
5
- * NOTE: Headers is a Map<String,String> because rfc2616 defines
6
- * multi-valued headers as csv-only.
7
- */
8
- data class PartConfig<T>(
9
- val headers: MutableMap<String, String> = mutableMapOf(),
10
- val body: T? = null
11
- )
1
+ package @PACKAGE_NAME@
2
+
3
+ /**
4
+ * Defines a config object for a given part of a multi-part request.
5
+ * NOTE: Headers is a Map<String,String> because rfc2616 defines
6
+ * multi-valued headers as csv-only.
7
+ */
8
+ data class PartConfig<T>(
9
+ val headers: MutableMap<String, String> = mutableMapOf(),
10
+ val body: T? = null
11
+ )
@@ -1,18 +1,18 @@
1
- package @PACKAGE_NAME@
2
-
3
- /**
4
- * Defines a config object for a given request.
5
- * NOTE: This object doesn't include 'body' because it
6
- * allows for caching of the constructed object
7
- * for many request definitions.
8
- * NOTE: Headers is a Map<String,String> because rfc2616 defines
9
- * multi-valued headers as csv-only.
10
- */
11
- data class RequestConfig<T>(
12
- val method: RequestMethod,
13
- val path: String,
14
- val headers: MutableMap<String, String> = mutableMapOf(),
15
- val query: MutableMap<String, List<String>> = mutableMapOf(),
16
- val requiresAuthentication: Boolean,
17
- val body: T? = null
18
- )
1
+ package @PACKAGE_NAME@
2
+
3
+ /**
4
+ * Defines a config object for a given request.
5
+ * NOTE: This object doesn't include 'body' because it
6
+ * allows for caching of the constructed object
7
+ * for many request definitions.
8
+ * NOTE: Headers is a Map<String,String> because rfc2616 defines
9
+ * multi-valued headers as csv-only.
10
+ */
11
+ data class RequestConfig<T>(
12
+ val method: RequestMethod,
13
+ val path: String,
14
+ val headers: MutableMap<String, String> = mutableMapOf(),
15
+ val query: MutableMap<String, List<String>> = mutableMapOf(),
16
+ val requiresAuthentication: Boolean,
17
+ val body: T? = null
18
+ )
@@ -1,8 +1,8 @@
1
- package @PACKAGE_NAME@
2
-
3
- /**
4
- * Provides enumerated HTTP verbs
5
- */
6
- enum class RequestMethod {
7
- GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
8
- }
1
+ package @PACKAGE_NAME@
2
+
3
+ /**
4
+ * Provides enumerated HTTP verbs
5
+ */
6
+ enum class RequestMethod {
7
+ GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
8
+ }
@@ -1,24 +1,24 @@
1
- package @PACKAGE_NAME@
2
-
3
- import okhttp3.Response
4
-
5
- /**
6
- * Provides an extension to evaluation whether the response is a 1xx code
7
- */
8
- val Response.isInformational: Boolean get() = this.code in 100..199
9
-
10
- /**
11
- * Provides an extension to evaluation whether the response is a 3xx code
12
- */
13
- @Suppress("EXTENSION_SHADOWED_BY_MEMBER")
14
- val Response.isRedirect: Boolean get() = this.code in 300..399
15
-
16
- /**
17
- * Provides an extension to evaluation whether the response is a 4xx code
18
- */
19
- val Response.isClientError: Boolean get() = this.code in 400..499
20
-
21
- /**
22
- * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
23
- */
24
- val Response.isServerError: Boolean get() = this.code in 500..999
1
+ package @PACKAGE_NAME@
2
+
3
+ import okhttp3.Response
4
+
5
+ /**
6
+ * Provides an extension to evaluation whether the response is a 1xx code
7
+ */
8
+ val Response.isInformational: Boolean get() = this.code in 100..199
9
+
10
+ /**
11
+ * Provides an extension to evaluation whether the response is a 3xx code
12
+ */
13
+ @Suppress("EXTENSION_SHADOWED_BY_MEMBER")
14
+ val Response.isRedirect: Boolean get() = this.code in 300..399
15
+
16
+ /**
17
+ * Provides an extension to evaluation whether the response is a 4xx code
18
+ */
19
+ val Response.isClientError: Boolean get() = this.code in 400..499
20
+
21
+ /**
22
+ * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
23
+ */
24
+ val Response.isServerError: Boolean get() = this.code in 500..999
@@ -1,33 +1,33 @@
1
- package @PACKAGE_NAME@
2
-
3
- import org.springframework.core.io.buffer.DataBuffer
4
- import org.springframework.http.MediaType
5
- import org.springframework.http.client.MultipartBodyBuilder
6
- import org.springframework.http.codec.multipart.FilePart
7
- import java.io.File
8
-
9
- interface ApiRequestFile {
10
- companion object {
11
- fun from(file: File): ApiRequestFile =
12
- object : ApiRequestFile {
13
- override fun addToBuilder(builder: MultipartBodyBuilder) {
14
- builder
15
- .part("file", file)
16
- .filename(file.name)
17
- .contentType(MediaType.APPLICATION_OCTET_STREAM)
18
- }
19
- }
20
-
21
- fun from(filePart: FilePart): ApiRequestFile =
22
- object : ApiRequestFile {
23
- override fun addToBuilder(builder: MultipartBodyBuilder) {
24
- builder
25
- .asyncPart("file", filePart.content(), DataBuffer::class.java)
26
- .filename(filePart.filename())
27
- .contentType(filePart.headers().contentType ?: MediaType.APPLICATION_OCTET_STREAM)
28
- }
29
- }
30
- }
31
-
32
- fun addToBuilder(builder: MultipartBodyBuilder)
33
- }
1
+ package @PACKAGE_NAME@
2
+
3
+ import org.springframework.core.io.buffer.DataBuffer
4
+ import org.springframework.http.MediaType
5
+ import org.springframework.http.client.MultipartBodyBuilder
6
+ import org.springframework.http.codec.multipart.FilePart
7
+ import java.io.File
8
+
9
+ interface ApiRequestFile {
10
+ companion object {
11
+ fun from(file: File): ApiRequestFile =
12
+ object : ApiRequestFile {
13
+ override fun addToBuilder(builder: MultipartBodyBuilder) {
14
+ builder
15
+ .part("file", file)
16
+ .filename(file.name)
17
+ .contentType(MediaType.APPLICATION_OCTET_STREAM)
18
+ }
19
+ }
20
+
21
+ fun from(filePart: FilePart): ApiRequestFile =
22
+ object : ApiRequestFile {
23
+ override fun addToBuilder(builder: MultipartBodyBuilder) {
24
+ builder
25
+ .asyncPart("file", filePart.content(), DataBuffer::class.java)
26
+ .filename(filePart.filename())
27
+ .contentType(filePart.headers().contentType ?: MediaType.APPLICATION_OCTET_STREAM)
28
+ }
29
+ }
30
+ }
31
+
32
+ fun addToBuilder(builder: MultipartBodyBuilder)
33
+ }
@@ -6,4 +6,5 @@ export declare const requestHeadersSpec: KtGenericReferenceFactory<1>;
6
6
  export declare const toEntity: KtGenericReferenceFactory<1>;
7
7
  export declare const awaitBody: KtGenericReferenceFactory<1>;
8
8
  export declare const awaitBodilessEntity: KtReferenceFactory;
9
+ export declare const awaitExchange: KtReferenceFactory;
9
10
  //# sourceMappingURL=spring-reactive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spring-reactive.d.ts","sourceRoot":"","sources":["../../../../src/src/ast/references/spring-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAe,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG7G,eAAO,MAAM,aAAa,EAAE,kBAG3B,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,kBAGvB,CAAC;AACF,eAAO,MAAM,cAAc,EAAE,kBAG5B,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CAAC,CAAC,CAG3D,CAAC;AACF,eAAO,MAAM,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAGjD,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,yBAAyB,CAAC,CAAC,CAGlD,CAAC;AACF,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAC"}
1
+ {"version":3,"file":"spring-reactive.d.ts","sourceRoot":"","sources":["../../../../src/src/ast/references/spring-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAe,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG7G,eAAO,MAAM,aAAa,EAAE,kBAG3B,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,kBAGvB,CAAC;AACF,eAAO,MAAM,cAAc,EAAE,kBAG5B,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CAAC,CAAC,CAG3D,CAAC;AACF,eAAO,MAAM,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAGjD,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,yBAAyB,CAAC,CAAC,CAGlD,CAAC;AACF,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,kBAG3B,CAAC"}
@@ -8,3 +8,4 @@ export const requestHeadersSpec = ktReference.genericFactory('RequestHeadersSpec
8
8
  export const toEntity = ktReference.genericFactory('toEntity', 'org.springframework.web.reactive.function.client');
9
9
  export const awaitBody = ktReference.genericFactory('awaitBody', 'org.springframework.web.reactive.function.client');
10
10
  export const awaitBodilessEntity = ktReference.factory('awaitBodilessEntity', 'org.springframework.web.reactive.function.client');
11
+ export const awaitExchange = ktReference.factory('awaitExchange', 'org.springframework.web.reactive.function.client');
@@ -109,31 +109,31 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
109
109
  return appendValueGroup([
110
110
  s `val localVarResponse = ${kt.call([toCasing(endpoint.name + '_WithHttpInfo', ctx.config.functionNameCasing)], parameters.map((x) => toCasing(x.name, ctx.config.parameterNameCasing)))}`,
111
111
  '',
112
- s `return when (localVarResponse.responseType) {${s.indent `
112
+ s `return when (localVarResponse.responseType) {${s.indent `
113
113
  ${ctx.refs.responseType()}.Success -> ${responseSchema === undefined
114
114
  ? kt.refs.unit()
115
115
  : s `(localVarResponse as ${ctx.refs.success(['*'])}).data as ${this.getTypeUsage(ctx, {
116
116
  schema: responseSchema,
117
- })}`}
118
- ${ctx.refs.responseType()}.Informational -> throw ${kt.refs.java.unsupportedOperationException()}("Client does not support Informational responses.")
119
- ${ctx.refs.responseType()}.Redirection -> throw ${kt.refs.java.unsupportedOperationException()}("Client does not support Redirection responses.")
120
- ${ctx.refs.responseType()}.ClientError -> {${s.indent `
121
- val localVarError = localVarResponse as ${ctx.refs.clientError(['*'])}
122
- throw ${ctx.refs.clientException()}(${s.indent `
123
- "Client error : \${localVarError.statusCode} \${localVarError.message.orEmpty()}",
124
- localVarError.statusCode,
125
- localVarResponse`}
126
- )`}
127
- }
128
-
129
- ${ctx.refs.responseType()}.ServerError -> {${s.indent `
130
- val localVarError = localVarResponse as ${ctx.refs.serverError(['*'])}
131
- throw ${ctx.refs.serverException()}(${s.indent `
132
- "Server error : \${localVarError.statusCode} \${localVarError.message.orEmpty()}",
133
- localVarError.statusCode,
134
- localVarResponse`}
135
- )`}
136
- }`}
117
+ })}`}
118
+ ${ctx.refs.responseType()}.Informational -> throw ${kt.refs.java.unsupportedOperationException()}("Client does not support Informational responses.")
119
+ ${ctx.refs.responseType()}.Redirection -> throw ${kt.refs.java.unsupportedOperationException()}("Client does not support Redirection responses.")
120
+ ${ctx.refs.responseType()}.ClientError -> {${s.indent `
121
+ val localVarError = localVarResponse as ${ctx.refs.clientError(['*'])}
122
+ throw ${ctx.refs.clientException()}(${s.indent `
123
+ "Client error : \${localVarError.statusCode} \${localVarError.message.orEmpty()}",
124
+ localVarError.statusCode,
125
+ localVarResponse`}
126
+ )`}
127
+ }
128
+
129
+ ${ctx.refs.responseType()}.ServerError -> {${s.indent `
130
+ val localVarError = localVarResponse as ${ctx.refs.serverError(['*'])}
131
+ throw ${ctx.refs.serverException()}(${s.indent `
132
+ "Server error : \${localVarError.statusCode} \${localVarError.message.orEmpty()}",
133
+ localVarError.statusCode,
134
+ localVarResponse`}
135
+ )`}
136
+ }`}
137
137
  }`,
138
138
  ], '\n');
139
139
  }
@@ -212,16 +212,16 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
212
212
  result.values.push(`val localVariableBody = ${bodyParamName}`);
213
213
  }
214
214
  }
215
- result.values.push(s `val localVariableQuery: ${ctx.refs.multiValueMap()} = ${kt.call([kt.refs.mutableMapOf([kt.refs.string(), kt.refs.list([kt.refs.string()])])], [])}${queryParameters.length === 0 ? '' : s.indent `
216
- .apply {${s.indent `
215
+ result.values.push(s `val localVariableQuery: ${ctx.refs.multiValueMap()} = ${kt.call([kt.refs.mutableMapOf([kt.refs.string(), kt.refs.list([kt.refs.string()])])], [])}${queryParameters.length === 0 ? '' : s.indent `
216
+ .apply {${s.indent `
217
217
  ${appendValueGroup(queryParameters.map((param) => {
218
218
  const paramName = toCasing(param.name, ctx.config.parameterNameCasing);
219
219
  const toString = this.getParameterToString(ctx, { endpoint, parameter: param });
220
220
  const put = s `put(${kt.string(param.name)}, listOf(${paramName}${toString}))`;
221
- return param.required ? put : s `if (${paramName} != null) {${s.indent `
222
- ${put}`}
221
+ return param.required ? put : s `if (${paramName} != null) {${s.indent `
222
+ ${put}`}
223
223
  }`;
224
- }), '\n')}`}
224
+ }), '\n')}`}
225
225
  }`}`);
226
226
  result.values.push('val localVariableHeaders: MutableMap<String, String> = mutableMapOf()');
227
227
  if (((_b = endpoint.requestBody) === null || _b === void 0 ? void 0 : _b.content[0]) !== undefined) {
@@ -230,8 +230,8 @@ export class DefaultKotlinOkHttp3Generator extends KotlinFileGenerator {
230
230
  for (const header of headerParameters) {
231
231
  const paramName = toCasing(header.name, ctx.config.parameterNameCasing);
232
232
  const toString = this.getParameterToString(ctx, { endpoint, parameter: header });
233
- result.values.push(s `if (${paramName} != null) {${s.indent `
234
- localVariableHeaders["${header.name}"] = ${paramName}${toString}`}
233
+ result.values.push(s `if (${paramName} != null) {${s.indent `
234
+ localVariableHeaders["${header.name}"] = ${paramName}${toString}`}
235
235
  }`);
236
236
  }
237
237
  result.values.push(s `return ${kt.call([ctx.refs.requestConfig.infer()], [
@@ -100,16 +100,16 @@ export class KotlinOkHttp3ClientsGenerator extends OpenApiServicesGenerationProv
100
100
  const jsonIncludeMember = toCasing(ctx.config.serializerJsonInclude, 'snake');
101
101
  const defaultFactory = springBootVersion === 4
102
102
  // Jackson 3's ObjectMapper is immutable; configuration moved to the (Kotlin) mapper builder.
103
- ? s `${kt.refs.jackson.jacksonMapperBuilder(springBootVersion)}()${s.indent `
104
- .findAndAddModules()
105
- .changeDefaultPropertyInclusion { it.withValueInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember}).withContentInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember}) }
106
- .configure(${kt.refs.jackson.serializationFeature(springBootVersion)}.WRITE_DATES_AS_TIMESTAMPS, false)
107
- .configure(${kt.refs.jackson.deserializationFeature(springBootVersion)}.FAIL_ON_UNKNOWN_PROPERTIES, false)
103
+ ? s `${kt.refs.jackson.jacksonMapperBuilder(springBootVersion)}()${s.indent `
104
+ .findAndAddModules()
105
+ .changeDefaultPropertyInclusion { it.withValueInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember}).withContentInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember}) }
106
+ .configure(${kt.refs.jackson.serializationFeature(springBootVersion)}.WRITE_DATES_AS_TIMESTAMPS, false)
107
+ .configure(${kt.refs.jackson.deserializationFeature(springBootVersion)}.FAIL_ON_UNKNOWN_PROPERTIES, false)
108
108
  .build()`}`
109
- : s `${kt.refs.jackson.jacksonObjectMapper(springBootVersion)}()${s.indent `
110
- .findAndRegisterModules()
111
- .setSerializationInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember})
112
- .configure(${kt.refs.jackson.serializationFeature(springBootVersion)}.WRITE_DATES_AS_TIMESTAMPS, false)
109
+ : s `${kt.refs.jackson.jacksonObjectMapper(springBootVersion)}()${s.indent `
110
+ .findAndRegisterModules()
111
+ .setSerializationInclusion(${kt.refs.jackson.jsonInclude()}.Include.${jsonIncludeMember})
112
+ .configure(${kt.refs.jackson.serializationFeature(springBootVersion)}.WRITE_DATES_AS_TIMESTAMPS, false)
113
113
  .configure(${kt.refs.jackson.deserializationFeature(springBootVersion)}.FAIL_ON_UNKNOWN_PROPERTIES, false)`}`;
114
114
  const factory = typeof ctx.config.serializer === 'object'
115
115
  ? ctx.config.serializer.factory
@@ -257,13 +257,13 @@ export class DefaultKotlinSpringControllerGenerator extends KotlinFileGenerator
257
257
  }
258
258
  }
259
259
  });
260
- body.values.push(s `try {${s.indent `
260
+ body.values.push(s `try {${s.indent `
261
261
  return ${kt.call([
262
262
  kt.call(kt.reference('getDelegate'), []),
263
263
  toCasing(endpoint.name, ctx.config.functionNameCasing),
264
- ], parameters.map((x) => toCasing(x.name, ctx.config.parameterNameCasing)))}`}
265
- } catch (e: ${kt.refs.throwable()}) {${s.indent `
266
- return getExceptionHandler()?.handleApiException(e) ?: throw e`}
264
+ ], parameters.map((x) => toCasing(x.name, ctx.config.parameterNameCasing)))}`}
265
+ } catch (e: ${kt.refs.throwable()}) {${s.indent `
266
+ return getExceptionHandler()?.handleApiException(e) ?: throw e`}
267
267
  }`);
268
268
  return body;
269
269
  }
@@ -325,11 +325,11 @@ export class DefaultKotlinSpringControllerGenerator extends KotlinFileGenerator
325
325
  hasResponseBody ? kt.argument('body') : kt.toNode(null),
326
326
  kt.toNode(code),
327
327
  contentType
328
- ? s `${kt.refs.spring.linkedMultiValueMap([kt.refs.string(), kt.refs.string()])}().also {
329
- if (headers != null) {
330
- it.putAll(headers)
331
- }
332
- it.addIfAbsent("Content-Type", ${kt.string(contentType)})
328
+ ? s `${kt.refs.spring.linkedMultiValueMap([kt.refs.string(), kt.refs.string()])}().also {
329
+ if (headers != null) {
330
+ it.putAll(headers)
331
+ }
332
+ it.addIfAbsent("Content-Type", ${kt.string(contentType)})
333
333
  }`
334
334
  : kt.argument('headers'),
335
335
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"spring-reactive-web-client-generator.d.ts","sourceRoot":"","sources":["../../../../../src/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EAIrB,KAAK,YAAY,EAGjB,aAAa,EAEd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,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EAAE,IAAI,CAAC,WAAW,GAAG,MAAM;IAQpE,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,GAAG,MAAM;IAK3E,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,GAAG,MAAM;IAMnE,SAAS,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM;IAIvF,OAAO,CAAC,kBAAkB;CAgB3B"}
1
+ {"version":3,"file":"spring-reactive-web-client-generator.d.ts","sourceRoot":"","sources":["../../../../../src/src/generators/services/spring-reactive-web-clients/spring-reactive-web-client-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EAIrB,KAAK,YAAY,EAGjB,aAAa,EAEd,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,iDAAiD,IAAI,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,KAAK,EACV,6CAA6C,EAC7C,4CAA4C,EAC7C,MAAM,aAAa,CAAC;AAErB,KAAK,OAAO,GAAG,6CAA6C,CAAC;AAC7D,KAAK,MAAM,GAAG,4CAA4C,CAAC;AAC3D,KAAK,OAAO,GAAG,iBAAiB,CAAC;AAEjC,MAAM,WAAW,sCAAsC,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACrF,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,C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point })),
85
85
  suspend: true,
86
- // Spring 7's `WebClient.exchangeToMono` is `<V : Any>`, so the `<T>` overloads need an `Any` bound to infer.
86
+ // Spring 7's `WebClient.awaitExchange` is `<V : Any>`, so the `<T>` overloads need an `Any` bound to infer.
87
87
  generics: [
88
88
  kt.genericParameter('T', ctx.config.springBootVersion === 4 ? { constraint: kt.refs.any() } : undefined),
89
89
  ],
@@ -103,11 +103,8 @@ export class DefaultKotlinSpringReactiveWebClientGenerator extends KotlinFileGen
103
103
  const parameterNames = parameters.map((p) => toCasing(p.name, ctx.config.parameterNameCasing));
104
104
  result.values.push(s `return ${kt.call([
105
105
  kt.call(['this', requestFunctionName], parameterNames),
106
- kt.call(['exchangeToMono'], [
107
- kt.lambda([], kt.call(kt.refs.kotlinx.mono.infer(), [kt.lambda([], 'responseHandler(it)', { singleline: true })]), { singleline: true }),
108
- ]),
109
- kt.call([kt.refs.kotlinx.awaitFirstOrNull.infer()], []),
110
- ])} as T`);
106
+ kt.call([kt.refs.springReactive.awaitExchange()], ['responseHandler']),
107
+ ])}`);
111
108
  return result;
112
109
  }
113
110
  getEndpointRequestFunctionName(ctx, args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goast/kotlin",
3
- "version": "0.5.10",
3
+ "version": "0.5.11-beta.2",
4
4
  "description": "Provides gOAst generators for generating Kotlin code from OpenAPI specifications.",
5
5
  "author": {
6
6
  "name": "Marc Schmidt (MaSch0212)",
@@ -6,4 +6,5 @@ export declare const requestHeadersSpec: KtGenericReferenceFactory<1>;
6
6
  export declare const toEntity: KtGenericReferenceFactory<1>;
7
7
  export declare const awaitBody: KtGenericReferenceFactory<1>;
8
8
  export declare const awaitBodilessEntity: KtReferenceFactory;
9
+ export declare const awaitExchange: KtReferenceFactory;
9
10
  //# sourceMappingURL=spring-reactive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spring-reactive.d.ts","sourceRoot":"","sources":["../../../../src/src/ast/references/spring-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAe,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG7G,eAAO,MAAM,aAAa,EAAE,kBAG3B,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,kBAGvB,CAAC;AACF,eAAO,MAAM,cAAc,EAAE,kBAG5B,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CAAC,CAAC,CAG3D,CAAC;AACF,eAAO,MAAM,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAGjD,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,yBAAyB,CAAC,CAAC,CAGlD,CAAC;AACF,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAC"}
1
+ {"version":3,"file":"spring-reactive.d.ts","sourceRoot":"","sources":["../../../../src/src/ast/references/spring-reactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,yBAAyB,EAAe,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG7G,eAAO,MAAM,aAAa,EAAE,kBAG3B,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,kBAGvB,CAAC;AACF,eAAO,MAAM,cAAc,EAAE,kBAG5B,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CAAC,CAAC,CAG3D,CAAC;AACF,eAAO,MAAM,QAAQ,EAAE,yBAAyB,CAAC,CAAC,CAGjD,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,yBAAyB,CAAC,CAAC,CAGlD,CAAC;AACF,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,kBAG3B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.awaitBodilessEntity = exports.awaitBody = exports.toEntity = exports.requestHeadersSpec = exports.clientResponse = exports.webClient = exports.bodyInserters = void 0;
3
+ exports.awaitExchange = exports.awaitBodilessEntity = exports.awaitBody = exports.toEntity = exports.requestHeadersSpec = exports.clientResponse = exports.webClient = exports.bodyInserters = void 0;
4
4
  const reference_js_1 = require("../nodes/reference.js");
5
5
  // org.springframework.web.reactive.function
6
6
  exports.bodyInserters = reference_js_1.ktReference.factory('BodyInserters', 'org.springframework.web.reactive.function');
@@ -11,3 +11,4 @@ exports.requestHeadersSpec = reference_js_1.ktReference.genericFactory('RequestH
11
11
  exports.toEntity = reference_js_1.ktReference.genericFactory('toEntity', 'org.springframework.web.reactive.function.client');
12
12
  exports.awaitBody = reference_js_1.ktReference.genericFactory('awaitBody', 'org.springframework.web.reactive.function.client');
13
13
  exports.awaitBodilessEntity = reference_js_1.ktReference.factory('awaitBodilessEntity', 'org.springframework.web.reactive.function.client');
14
+ exports.awaitExchange = reference_js_1.ktReference.factory('awaitExchange', 'org.springframework.web.reactive.function.client');