Skip to content

Commit 9b60c46

Browse files
committed
update samples, docs
1 parent de8ea3b commit 9b60c46

35 files changed

Lines changed: 343 additions & 66 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-misk/src/main/kotlin/org/openapitools/server/api/model/Category.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ package org.openapitools.server.api.model
22

33

44
data class Category(
5-
val id: kotlin.Long?,
6-
val name: kotlin.String?
5+
val id: kotlin.Long? = null,
6+
val name: kotlin.String? = null
77
)

samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package org.openapitools.server.api.model
22

33

44
data class ModelApiResponse(
5-
val code: kotlin.Int?,
6-
val type: kotlin.String?,
7-
val message: kotlin.String?
5+
val code: kotlin.Int? = null,
6+
val type: kotlin.String? = null,
7+
val message: kotlin.String? = null
88
)

samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/Order.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package org.openapitools.server.api.model
22

33

44
data class Order(
5-
val id: kotlin.Long?,
6-
val petId: kotlin.Long?,
7-
val quantity: kotlin.Int?,
8-
val shipDate: java.time.OffsetDateTime?,
5+
val id: kotlin.Long? = null,
6+
val petId: kotlin.Long? = null,
7+
val quantity: kotlin.Int? = null,
8+
val shipDate: java.time.OffsetDateTime? = null,
99
/** Order Status */
10-
val status: kotlin.String?,
10+
val status: kotlin.String? = null,
1111
val complete: kotlin.Boolean? = false
1212
)

samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/Pet.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import org.openapitools.server.api.model.Tag
66
data class Pet(
77
val name: kotlin.String,
88
val photoUrls: kotlin.Array<kotlin.String>,
9-
val id: kotlin.Long?,
10-
val category: Category?,
11-
val tags: kotlin.Array<Tag>?,
9+
val id: kotlin.Long? = null,
10+
val category: Category? = null,
11+
val tags: kotlin.Array<Tag>? = null,
1212
/** pet status in the store */
13-
val status: kotlin.String?
13+
val status: kotlin.String? = null
1414
)

samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/Tag.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ package org.openapitools.server.api.model
22

33

44
data class Tag(
5-
val id: kotlin.Long?,
6-
val name: kotlin.String?
5+
val id: kotlin.Long? = null,
6+
val name: kotlin.String? = null
77
)

samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/User.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package org.openapitools.server.api.model
22

33

44
data class User(
5-
val id: kotlin.Long?,
6-
val username: kotlin.String?,
7-
val firstName: kotlin.String?,
8-
val lastName: kotlin.String?,
9-
val email: kotlin.String?,
10-
val password: kotlin.String?,
11-
val phone: kotlin.String?,
5+
val id: kotlin.Long? = null,
6+
val username: kotlin.String? = null,
7+
val firstName: kotlin.String? = null,
8+
val lastName: kotlin.String? = null,
9+
val email: kotlin.String? = null,
10+
val password: kotlin.String? = null,
11+
val phone: kotlin.String? = null,
1212
/** User Status */
13-
val userStatus: kotlin.Int?
13+
val userStatus: kotlin.Int? = null
1414
)

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

0 commit comments

Comments
 (0)