Skip to content

Commit 8ddf965

Browse files
author
andrewwilsonnew
committed
Merge remote-tracking branch 'origin/cashapp/misk' into cashapp/misk
2 parents 609f2ba + 9b60c46 commit 8ddf965

29 files changed

Lines changed: 319 additions & 42 deletions

File tree

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ The following generators are available:
122122
* [jaxrs-resteasy-eap](generators/jaxrs-resteasy-eap.md)
123123
* [jaxrs-spec](generators/jaxrs-spec.md)
124124
* [julia-server (beta)](generators/julia-server.md)
125+
* [kotlin-misk](generators/kotlin-misk.md)
125126
* [kotlin-server](generators/kotlin-server.md)
126127
* [kotlin-spring](generators/kotlin-spring.md)
127128
* [kotlin-vertx (beta)](generators/kotlin-vertx.md)

docs/generators/kotlin-misk.md

Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
---
2+
title: Documentation for the kotlin-misk Generator
3+
---
4+
5+
## METADATA
6+
7+
| Property | Value | Notes |
8+
| -------- | ----- | ----- |
9+
| generator name | kotlin-misk | pass this to the generate command after -g |
10+
| generator stability | STABLE | |
11+
| generator type | SERVER | |
12+
| generator language | Kotlin | |
13+
| generator default templating engine | mustache | |
14+
| helpTxt | Generates a kotlin-misk server. | |
15+
16+
## CONFIG OPTIONS
17+
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
18+
19+
| Option | Description | Values | Default |
20+
| ------ | ----------- | ------ | ------- |
21+
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
22+
|apiSuffix|suffix for api classes| |Api|
23+
|artifactId|Generated artifact id (name of jar).| |null|
24+
|artifactVersion|Generated artifact's package version.| |1.0.0|
25+
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original|
26+
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
27+
|modelMutable|Create mutable models| |false|
28+
|moduleClassName|Name of the generated module class| |OpenApiModule|
29+
|packageName|Generated artifact package name.| |org.openapitools|
30+
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
31+
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
32+
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
33+
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
34+
|sourceFolder|source folder for generated code| |src/main/kotlin|
35+
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
36+
37+
## IMPORT MAPPING
38+
39+
| Type/Alias | Imports |
40+
| ---------- | ------- |
41+
|BigDecimal|java.math.BigDecimal|
42+
|Date|java.time.LocalDate|
43+
|DateTime|java.time.OffsetDateTime|
44+
|File|java.io.File|
45+
|LocalDate|java.time.LocalDate|
46+
|LocalDateTime|java.time.LocalDateTime|
47+
|LocalTime|java.time.LocalTime|
48+
|Timestamp|java.sql.Timestamp|
49+
|URI|java.net.URI|
50+
|UUID|java.util.UUID|
51+
52+
53+
## INSTANTIATION TYPES
54+
55+
| Type/Alias | Instantiated By |
56+
| ---------- | --------------- |
57+
|array|kotlin.collections.ArrayList|
58+
|list|kotlin.collections.ArrayList|
59+
|map|kotlin.collections.HashMap|
60+
61+
62+
## LANGUAGE PRIMITIVES
63+
64+
<ul class="column-ul">
65+
<li>kotlin.Array</li>
66+
<li>kotlin.Boolean</li>
67+
<li>kotlin.Byte</li>
68+
<li>kotlin.ByteArray</li>
69+
<li>kotlin.Char</li>
70+
<li>kotlin.Double</li>
71+
<li>kotlin.Float</li>
72+
<li>kotlin.Int</li>
73+
<li>kotlin.Long</li>
74+
<li>kotlin.Short</li>
75+
<li>kotlin.String</li>
76+
<li>kotlin.collections.List</li>
77+
<li>kotlin.collections.Map</li>
78+
<li>kotlin.collections.MutableList</li>
79+
<li>kotlin.collections.MutableMap</li>
80+
<li>kotlin.collections.MutableSet</li>
81+
<li>kotlin.collections.Set</li>
82+
</ul>
83+
84+
## RESERVED WORDS
85+
86+
<ul class="column-ul">
87+
<li>ApiResponse</li>
88+
<li>abstract</li>
89+
<li>actual</li>
90+
<li>annotation</li>
91+
<li>as</li>
92+
<li>break</li>
93+
<li>class</li>
94+
<li>companion</li>
95+
<li>const</li>
96+
<li>constructor</li>
97+
<li>continue</li>
98+
<li>contract</li>
99+
<li>crossinline</li>
100+
<li>data</li>
101+
<li>delegate</li>
102+
<li>do</li>
103+
<li>dynamic</li>
104+
<li>else</li>
105+
<li>enum</li>
106+
<li>expect</li>
107+
<li>external</li>
108+
<li>false</li>
109+
<li>field</li>
110+
<li>final</li>
111+
<li>finally</li>
112+
<li>for</li>
113+
<li>fun</li>
114+
<li>if</li>
115+
<li>import</li>
116+
<li>in</li>
117+
<li>infix</li>
118+
<li>init</li>
119+
<li>inline</li>
120+
<li>inner</li>
121+
<li>interface</li>
122+
<li>internal</li>
123+
<li>is</li>
124+
<li>it</li>
125+
<li>lateinit</li>
126+
<li>noinline</li>
127+
<li>null</li>
128+
<li>object</li>
129+
<li>open</li>
130+
<li>operator</li>
131+
<li>out</li>
132+
<li>override</li>
133+
<li>package</li>
134+
<li>param</li>
135+
<li>private</li>
136+
<li>property</li>
137+
<li>protected</li>
138+
<li>public</li>
139+
<li>receiver</li>
140+
<li>reified</li>
141+
<li>return</li>
142+
<li>sealed</li>
143+
<li>setparam</li>
144+
<li>super</li>
145+
<li>suspend</li>
146+
<li>tailrec</li>
147+
<li>this</li>
148+
<li>throw</li>
149+
<li>true</li>
150+
<li>try</li>
151+
<li>typealias</li>
152+
<li>typeof</li>
153+
<li>val</li>
154+
<li>value</li>
155+
<li>var</li>
156+
<li>vararg</li>
157+
<li>when</li>
158+
<li>where</li>
159+
<li>while</li>
160+
</ul>
161+
162+
## FEATURE SET
163+
164+
165+
### Client Modification Feature
166+
| Name | Supported | Defined By |
167+
| ---- | --------- | ---------- |
168+
|BasePath|✗|ToolingExtension
169+
|Authorizations|✗|ToolingExtension
170+
|UserAgent|✗|ToolingExtension
171+
|MockServer|✗|ToolingExtension
172+
173+
### Data Type Feature
174+
| Name | Supported | Defined By |
175+
| ---- | --------- | ---------- |
176+
|Custom|✗|OAS2,OAS3
177+
|Int32|✓|OAS2,OAS3
178+
|Int64|✓|OAS2,OAS3
179+
|Float|✓|OAS2,OAS3
180+
|Double|✓|OAS2,OAS3
181+
|Decimal|✓|ToolingExtension
182+
|String|✓|OAS2,OAS3
183+
|Byte|✓|OAS2,OAS3
184+
|Binary|✓|OAS2,OAS3
185+
|Boolean|✓|OAS2,OAS3
186+
|Date|✓|OAS2,OAS3
187+
|DateTime|✓|OAS2,OAS3
188+
|Password|✓|OAS2,OAS3
189+
|File|✓|OAS2
190+
|Uuid||
191+
|Array|✓|OAS2,OAS3
192+
|Null|✗|OAS3
193+
|AnyType|✗|OAS2,OAS3
194+
|Object|✓|OAS2,OAS3
195+
|Maps|✓|ToolingExtension
196+
|CollectionFormat|✓|OAS2
197+
|CollectionFormatMulti|✓|OAS2
198+
|Enum|✓|OAS2,OAS3
199+
|ArrayOfEnum|✓|ToolingExtension
200+
|ArrayOfModel|✓|ToolingExtension
201+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
202+
|ArrayOfCollectionOfModel|✓|ToolingExtension
203+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
204+
|MapOfEnum|✓|ToolingExtension
205+
|MapOfModel|✓|ToolingExtension
206+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
207+
|MapOfCollectionOfModel|✓|ToolingExtension
208+
|MapOfCollectionOfEnum|✓|ToolingExtension
209+
210+
### Documentation Feature
211+
| Name | Supported | Defined By |
212+
| ---- | --------- | ---------- |
213+
|Readme|✓|ToolingExtension
214+
|Model|✓|ToolingExtension
215+
|Api|✓|ToolingExtension
216+
217+
### Global Feature
218+
| Name | Supported | Defined By |
219+
| ---- | --------- | ---------- |
220+
|Host|✓|OAS2,OAS3
221+
|BasePath|✓|OAS2,OAS3
222+
|Info|✓|OAS2,OAS3
223+
|Schemes|✗|OAS2,OAS3
224+
|PartialSchemes|✓|OAS2,OAS3
225+
|Consumes|✓|OAS2
226+
|Produces|✓|OAS2
227+
|ExternalDocumentation|✓|OAS2,OAS3
228+
|Examples|✓|OAS2,OAS3
229+
|XMLStructureDefinitions|✗|OAS2,OAS3
230+
|MultiServer|✗|OAS3
231+
|ParameterizedServer|✗|OAS3
232+
|ParameterStyling|✗|OAS3
233+
|Callbacks|✗|OAS3
234+
|LinkObjects|✗|OAS3
235+
236+
### Parameter Feature
237+
| Name | Supported | Defined By |
238+
| ---- | --------- | ---------- |
239+
|Path|✓|OAS2,OAS3
240+
|Query|✓|OAS2,OAS3
241+
|Header|✓|OAS2,OAS3
242+
|Body|✓|OAS2
243+
|FormUnencoded|✓|OAS2
244+
|FormMultipart|✓|OAS2
245+
|Cookie|✓|OAS3
246+
247+
### Schema Support Feature
248+
| Name | Supported | Defined By |
249+
| ---- | --------- | ---------- |
250+
|Simple|✓|OAS2,OAS3
251+
|Composite|✓|OAS2,OAS3
252+
|Polymorphism|✗|OAS2,OAS3
253+
|Union|✗|OAS3
254+
|allOf|✗|OAS2,OAS3
255+
|anyOf|✗|OAS3
256+
|oneOf|✗|OAS3
257+
|not|✗|OAS3
258+
259+
### Security Feature
260+
| Name | Supported | Defined By |
261+
| ---- | --------- | ---------- |
262+
|BasicAuth|✗|OAS2,OAS3
263+
|ApiKey|✗|OAS2,OAS3
264+
|OpenIDConnect|✗|OAS3
265+
|BearerToken|✗|OAS3
266+
|OAuth2_Implicit|✗|OAS2,OAS3
267+
|OAuth2_Password|✗|OAS2,OAS3
268+
|OAuth2_ClientCredentials|✗|OAS2,OAS3
269+
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
270+
|SignatureAuth|✗|OAS3
271+
|AWSV4Signature|✗|ToolingExtension
272+
273+
### Wire Format Feature
274+
| Name | Supported | Defined By |
275+
| ---- | --------- | ---------- |
276+
|JSON|✗|OAS2,OAS3
277+
|XML|✗|OAS2,OAS3
278+
|PROTOBUF|✓|ToolingExtension
279+
|Custom|✗|OAS2,OAS3

samples/server/petstore/kotlin-misk/.openapi-generator/FILES

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,3 @@ src/main/kotlin/org/openapitools/server/api/model/Order.kt
2626
src/main/kotlin/org/openapitools/server/api/model/Pet.kt
2727
src/main/kotlin/org/openapitools/server/api/model/Tag.kt
2828
src/main/kotlin/org/openapitools/server/api/model/User.kt
29-
src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt
30-
src/test/kotlin/org/openapitools/server/api/api/StoreApiTest.kt
31-
src/test/kotlin/org/openapitools/server/api/api/UserApiTest.kt

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ interface PetApi {
5858
value = ["/pet/findByStatus"],
5959
produces = ["application/xml", "application/json"]
6060
)
61-
fun findPetsByStatus(@NotNull @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
61+
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
6262
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
6363
}
6464

@@ -68,7 +68,7 @@ interface PetApi {
6868
value = ["/pet/findByTags"],
6969
produces = ["application/xml", "application/json"]
7070
)
71-
fun findPetsByTags(@NotNull @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
71+
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
7272
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
7373
}
7474

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ interface UserApi {
8686
value = ["/user/login"],
8787
produces = ["application/xml", "application/json"]
8888
)
89-
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
89+
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
9090
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
9191
}
9292

samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class PetApiController() {
8383
value = ["/pet/findByStatus"],
8484
produces = ["application/xml", "application/json"]
8585
)
86-
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
86+
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
8787
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
8888
}
8989

@@ -101,7 +101,7 @@ class PetApiController() {
101101
value = ["/pet/findByTags"],
102102
produces = ["application/xml", "application/json"]
103103
)
104-
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
104+
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
105105
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
106106
}
107107

samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/UserApiController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class UserApiController() {
132132
value = ["/user/login"],
133133
produces = ["application/xml", "application/json"]
134134
)
135-
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
135+
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
136136
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
137137
}
138138

samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
5454
value = ["/pet/findByStatus"],
5555
produces = ["application/xml", "application/json"]
5656
)
57-
fun findPetsByStatus(@NotNull @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
57+
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
5858
return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200))
5959
}
6060

@@ -64,7 +64,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
6464
value = ["/pet/findByTags"],
6565
produces = ["application/xml", "application/json"]
6666
)
67-
fun findPetsByTags(@NotNull @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
67+
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
6868
return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200))
6969
}
7070

samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
8282
value = ["/user/login"],
8383
produces = ["application/xml", "application/json"]
8484
)
85-
fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
85+
fun loginUser( @RequestParam(value = "username", required = true) username: kotlin.String, @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
8686
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
8787
}
8888

samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ interface PetApi {
9696
value = ["/pet/findByStatus"],
9797
produces = ["application/xml", "application/json"]
9898
)
99-
fun findPetsByStatus(@NotNull @Parameter(description = "Status values that need to be considered for filter", required = true, schema = Schema(allowableValues = ["available", "pending", "sold"])) @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
99+
fun findPetsByStatus( @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
100100
return getDelegate().findPetsByStatus(status)
101101
}
102102

@@ -116,7 +116,7 @@ interface PetApi {
116116
value = ["/pet/findByTags"],
117117
produces = ["application/xml", "application/json"]
118118
)
119-
fun findPetsByTags(@NotNull @Parameter(description = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
119+
fun findPetsByTags( @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String>): ResponseEntity<List<Pet>> {
120120
return getDelegate().findPetsByTags(tags)
121121
}
122122

0 commit comments

Comments
 (0)