Skip to content

Commit e1130c3

Browse files
authored
Added HTTP method+path to JavaDocs in kotlin clients (#20618)
* feat: Added HTTP method+path to JavaDocs in kotlin OkHTTP client * feat: Added HTTP method+path to JavaDocs in kotlin Ktor client * feat: Added HTTP method+path to JavaDocs in kotlin retrofit2 client * feat: Added HTTP method+path to JavaDocs in kotlin vertex client * feat: Added HTTP method+path to JavaDocs in kotlin volley client
1 parent adbbe68 commit e1130c3

File tree

113 files changed

+1007
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1007
-0
lines changed

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
4343
4444
{{#operation}}
4545
/**
46+
* {{{httpMethod}}} {{{path}}}
4647
* {{summary}}
4748
* {{notes}}
4849
{{#allParams}} * @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ import {{packageName}}.infrastructure.toMultiValue
123123
{{/isEnum}}
124124
{{/allParams}}
125125
/**
126+
* {{{httpMethod}}} {{{path}}}
126127
* {{summary}}
127128
* {{notes}}
128129
{{#allParams}}* @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}
@@ -160,6 +161,7 @@ import {{packageName}}.infrastructure.toMultiValue
160161
}
161162

162163
/**
164+
* {{{httpMethod}}} {{{path}}}
163165
* {{summary}}
164166
* {{notes}}
165167
{{#allParams}}* @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ import okhttp3.MultipartBody
131131
{{/isEnum}}
132132
{{/allParams}}
133133
/**
134+
* {{{httpMethod}}} {{{path}}}
134135
* {{summary}}
135136
* {{notes}}
136137
* Responses:{{#responses}}

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ import {{packageName}}.infrastructure.*
8888
{{/isEnum}}
8989
{{/allParams}}
9090
/**
91+
* {{{httpMethod}}} {{{path}}}
9192
* {{summary}}
9293
* {{notes}}
9394
{{#allParams}}* @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}
@@ -122,6 +123,7 @@ import {{packageName}}.infrastructure.*
122123
}
123124

124125
/**
126+
* {{{httpMethod}}} {{{path}}}
125127
* {{summary}}
126128
* {{notes}}
127129
{{#allParams}}* @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import {{packageName}}.infrastructure.CollectionFormats.*
3737
3838
{{#operation}}
3939
/**
40+
* {{{httpMethod}}} {{{path}}}
4041
* {{summary}}
4142
* {{notes}}
4243
{{#allParams}}* @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}

samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class AuthApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
4545
}
4646

4747
/**
48+
* POST /auth/http/basic
4849
* To test HTTP basic authentication
4950
* To test HTTP basic authentication
5051
* @return kotlin.String
@@ -75,6 +76,7 @@ class AuthApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
7576
}
7677

7778
/**
79+
* POST /auth/http/basic
7880
* To test HTTP basic authentication
7981
* To test HTTP basic authentication
8082
* @return ApiResponse<kotlin.String?>
@@ -113,6 +115,7 @@ class AuthApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
113115
}
114116

115117
/**
118+
* POST /auth/http/bearer
116119
* To test HTTP bearer authentication
117120
* To test HTTP bearer authentication
118121
* @return kotlin.String
@@ -143,6 +146,7 @@ class AuthApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
143146
}
144147

145148
/**
149+
* POST /auth/http/bearer
146150
* To test HTTP bearer authentication
147151
* To test HTTP bearer authentication
148152
* @return ApiResponse<kotlin.String?>

samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt

+16
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
4747
}
4848

4949
/**
50+
* POST /binary/gif
5051
* Test binary (gif) response body
5152
* Test binary (gif) response body
5253
* @return java.io.File
@@ -77,6 +78,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
7778
}
7879

7980
/**
81+
* POST /binary/gif
8082
* Test binary (gif) response body
8183
* Test binary (gif) response body
8284
* @return ApiResponse<java.io.File?>
@@ -114,6 +116,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
114116
}
115117

116118
/**
119+
* POST /body/application/octetstream/binary
117120
* Test body parameter(s)
118121
* Test body parameter(s)
119122
* @param body (optional)
@@ -145,6 +148,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
145148
}
146149

147150
/**
151+
* POST /body/application/octetstream/binary
148152
* Test body parameter(s)
149153
* Test body parameter(s)
150154
* @param body (optional)
@@ -186,6 +190,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
186190
}
187191

188192
/**
193+
* POST /body/application/octetstream/array_of_binary
189194
* Test array of binary in multipart mime
190195
* Test array of binary in multipart mime
191196
* @param files
@@ -217,6 +222,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
217222
}
218223

219224
/**
225+
* POST /body/application/octetstream/array_of_binary
220226
* Test array of binary in multipart mime
221227
* Test array of binary in multipart mime
222228
* @param files
@@ -258,6 +264,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
258264
}
259265

260266
/**
267+
* POST /body/application/octetstream/single_binary
261268
* Test single binary in multipart mime
262269
* Test single binary in multipart mime
263270
* @param myFile (optional)
@@ -289,6 +296,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
289296
}
290297

291298
/**
299+
* POST /body/application/octetstream/single_binary
292300
* Test single binary in multipart mime
293301
* Test single binary in multipart mime
294302
* @param myFile (optional)
@@ -330,6 +338,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
330338
}
331339

332340
/**
341+
* POST /echo/body/FreeFormObject/response_string
333342
* Test free form object
334343
* Test free form object
335344
* @param body Free form object (optional)
@@ -361,6 +370,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
361370
}
362371

363372
/**
373+
* POST /echo/body/FreeFormObject/response_string
364374
* Test free form object
365375
* Test free form object
366376
* @param body Free form object (optional)
@@ -402,6 +412,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
402412
}
403413

404414
/**
415+
* POST /echo/body/Pet
405416
* Test body parameter(s)
406417
* Test body parameter(s)
407418
* @param apiPet Pet object that needs to be added to the store (optional)
@@ -433,6 +444,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
433444
}
434445

435446
/**
447+
* POST /echo/body/Pet
436448
* Test body parameter(s)
437449
* Test body parameter(s)
438450
* @param apiPet Pet object that needs to be added to the store (optional)
@@ -474,6 +486,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
474486
}
475487

476488
/**
489+
* POST /echo/body/Pet/response_string
477490
* Test empty response body
478491
* Test empty response body
479492
* @param apiPet Pet object that needs to be added to the store (optional)
@@ -505,6 +518,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
505518
}
506519

507520
/**
521+
* POST /echo/body/Pet/response_string
508522
* Test empty response body
509523
* Test empty response body
510524
* @param apiPet Pet object that needs to be added to the store (optional)
@@ -546,6 +560,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
546560
}
547561

548562
/**
563+
* POST /echo/body/Tag/response_string
549564
* Test empty json (request body)
550565
* Test empty json (request body)
551566
* @param apiTag Tag object (optional)
@@ -577,6 +592,7 @@ class BodyApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
577592
}
578593

579594
/**
595+
* POST /echo/body/Tag/response_string
580596
* Test empty json (request body)
581597
* Test empty json (request body)
582598
* @param apiTag Tag object (optional)

samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/FormApi.kt

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class FormApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
4545
}
4646

4747
/**
48+
* POST /form/integer/boolean/string
4849
* Test form parameter(s)
4950
* Test form parameter(s)
5051
* @param integerForm (optional)
@@ -78,6 +79,7 @@ class FormApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
7879
}
7980

8081
/**
82+
* POST /form/integer/boolean/string
8183
* Test form parameter(s)
8284
* Test form parameter(s)
8385
* @param integerForm (optional)
@@ -125,6 +127,7 @@ class FormApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
125127
}
126128

127129
/**
130+
* POST /form/oneof
128131
* Test form parameter(s) for oneOf schema
129132
* Test form parameter(s) for oneOf schema
130133
* @param form1 (optional)
@@ -161,6 +164,7 @@ class FormApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
161164
}
162165

163166
/**
167+
* POST /form/oneof
164168
* Test form parameter(s) for oneOf schema
165169
* Test form parameter(s) for oneOf schema
166170
* @param form1 (optional)

samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class HeaderApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory
6464
}
6565

6666
/**
67+
* GET /header/integer/boolean/string/enums
6768
* Test header parameter(s)
6869
* Test header parameter(s)
6970
* @param integerHeader (optional)
@@ -99,6 +100,7 @@ class HeaderApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory
99100
}
100101

101102
/**
103+
* GET /header/integer/boolean/string/enums
102104
* Test header parameter(s)
103105
* Test header parameter(s)
104106
* @param integerHeader (optional)

samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/PathApi.kt

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class PathApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
6464
}
6565

6666
/**
67+
* GET /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}
6768
* Test path parameter(s)
6869
* Test path parameter(s)
6970
* @param pathString
@@ -98,6 +99,7 @@ class PathApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
9899
}
99100

100101
/**
102+
* GET /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}
101103
* Test path parameter(s)
102104
* Test path parameter(s)
103105
* @param pathString

samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
6666
}
6767

6868
/**
69+
* GET /query/enum_ref_string
6970
* Test query parameter(s)
7071
* Test query parameter(s)
7172
* @param enumNonrefStringQuery (optional)
@@ -98,6 +99,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
9899
}
99100

100101
/**
102+
* GET /query/enum_ref_string
101103
* Test query parameter(s)
102104
* Test query parameter(s)
103105
* @param enumNonrefStringQuery (optional)
@@ -148,6 +150,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
148150
}
149151

150152
/**
153+
* GET /query/datetime/date/string
151154
* Test query parameter(s)
152155
* Test query parameter(s)
153156
* @param datetimeQuery (optional)
@@ -181,6 +184,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
181184
}
182185

183186
/**
187+
* GET /query/datetime/date/string
184188
* Test query parameter(s)
185189
* Test query parameter(s)
186190
* @param datetimeQuery (optional)
@@ -236,6 +240,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
236240
}
237241

238242
/**
243+
* GET /query/integer/boolean/string
239244
* Test query parameter(s)
240245
* Test query parameter(s)
241246
* @param integerQuery (optional)
@@ -269,6 +274,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
269274
}
270275

271276
/**
277+
* GET /query/integer/boolean/string
272278
* Test query parameter(s)
273279
* Test query parameter(s)
274280
* @param integerQuery (optional)
@@ -324,6 +330,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
324330
}
325331

326332
/**
333+
* GET /query/style_deepObject/explode_true/object
327334
* Test query parameter(s)
328335
* Test query parameter(s)
329336
* @param queryObject (optional)
@@ -355,6 +362,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
355362
}
356363

357364
/**
365+
* GET /query/style_deepObject/explode_true/object
358366
* Test query parameter(s)
359367
* Test query parameter(s)
360368
* @param queryObject (optional)
@@ -400,6 +408,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
400408
}
401409

402410
/**
411+
* GET /query/style_form/explode_true/array_string
403412
* Test query parameter(s)
404413
* Test query parameter(s)
405414
* @param queryObject (optional)
@@ -431,6 +440,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
431440
}
432441

433442
/**
443+
* GET /query/style_form/explode_true/array_string
434444
* Test query parameter(s)
435445
* Test query parameter(s)
436446
* @param queryObject (optional)
@@ -476,6 +486,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
476486
}
477487

478488
/**
489+
* GET /query/style_form/explode_true/object
479490
* Test query parameter(s)
480491
* Test query parameter(s)
481492
* @param queryObject (optional)
@@ -507,6 +518,7 @@ class QueryApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory =
507518
}
508519

509520
/**
521+
* GET /query/style_form/explode_true/object
510522
* Test query parameter(s)
511523
* Test query parameter(s)
512524
* @param queryObject (optional)

samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.google.gson.annotations.SerializedName
99

1010
interface AuthApi {
1111
/**
12+
* POST auth/http/basic
1213
* To test HTTP basic authentication
1314
* To test HTTP basic authentication
1415
* Responses:
@@ -20,6 +21,7 @@ interface AuthApi {
2021
suspend fun testAuthHttpBasic(): Response<kotlin.String>
2122

2223
/**
24+
* POST auth/http/bearer
2325
* To test HTTP bearer authentication
2426
* To test HTTP bearer authentication
2527
* Responses:

0 commit comments

Comments
 (0)