Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
08b5c37
Added resources for new multiplatform client
cromefire Sep 4, 2020
8ba5235
Added options
cromefire Sep 5, 2020
a8a06c1
Fitted Codegen to generate files
cromefire Sep 6, 2020
6b7e7d9
Added kotlinx date time library as new option
cromefire Sep 26, 2020
c503606
Fixe generation for collected client
cromefire Sep 26, 2020
b31464c
Fixed some conditional generation for kotlinx date time library
cromefire Sep 26, 2020
94056d1
Improved initialization time of the client container
cromefire Sep 26, 2020
4f01ed6
Fixed drone tests
cromefire Sep 26, 2020
1c5abbb
Improved test configs
cromefire Sep 26, 2020
36e5ad6
Enabled explicit api mode
cromefire Sep 26, 2020
c8eff68
fixed some multiplatform cli properties parsing issues
fullkomnun Dec 30, 2020
6d00a8a
generation of imports and 'UseSerializers' declarations for kotlinx.d…
fullkomnun Dec 30, 2020
6cb94b4
renamed infrastructure file 'dateTime.kt' to 'DateTime.kt'
fullkomnun Dec 30, 2020
3ea7f0e
fixed some multiplatform cli properties parsing issues
cromefire Dec 30, 2020
3e2ca4b
fix indentation of kotlinx.datetime import statements
fullkomnun Dec 31, 2020
5bb6a79
Merge branch 'master' into multiplatform-client
cromefire Dec 31, 2020
e2e7107
fix indentation
fullkomnun Jan 1, 2021
d264d0f
Merge pull request #3 from fullkomnun/kotlinx_date_library_conditiona…
cromefire Jan 1, 2021
a25ff86
prefer lists to arrays (also makes serialization simpler when request…
fullkomnun Jan 1, 2021
3df38f4
leverage kotlinx.serialization to drop array/map wrappers of requests…
fullkomnun Jan 1, 2021
95b1f4a
Added Promise-based async support for js
cromefire Jan 2, 2021
9999d4e
Updated docs
cromefire Jan 3, 2021
6fcf620
Generate a valid ApiClient.kt when a custom apiPackage is specified.
justasm Jan 3, 2021
3022037
Merge pull request #6 from justasm/respect-api-package
cromefire Jan 3, 2021
5a8f485
Use the isMap instead of isMapContainer mustache tag.
justasm Jan 3, 2021
d56ed12
Fixed addition of mapped parameters
cromefire Jan 3, 2021
384c042
Merge remote-tracking branch 'origin/multiplatform-client' into multi…
cromefire Jan 3, 2021
9734807
Merge pull request #7 from justasm/fix-is-map-container
cromefire Jan 3, 2021
3b455f9
Marked ApiClients as open
cromefire Jan 3, 2021
e7f474f
Merge remote-tracking branch 'origin/multiplatform-client' into multi…
cromefire Jan 3, 2021
38c68fe
Properly map `object`
cromefire Jan 3, 2021
f73a520
Added missing break
cromefire Jan 3, 2021
008e321
Mapped AnyType to JsonElement
cromefire Jan 3, 2021
14bddcd
Merge branch 'multiplatform-client' into fix_request_response_collect…
cromefire Jan 3, 2021
f3f8015
Mapped date-time to the new OffsetDateTime
cromefire Jan 3, 2021
35b8a36
Revert "Mapped date-time to the new OffsetDateTime"
cromefire Jan 3, 2021
824a579
Removed accidentaly committed file
cromefire Jan 3, 2021
1f18ae3
Mapped date-time to the new OffsetDateTime
cromefire Jan 3, 2021
0e76206
Fixed enum styling and nested enum generation
cromefire Jan 3, 2021
35f9d04
Merge branch 'multiplatform-client' into fix_request_response_collect…
cromefire Jan 3, 2021
82370c6
Use ZoneOffset for OffsetDateTime
cromefire Jan 3, 2021
6d071f9
Added OffsetDateTime mapping for DateTime
cromefire Jan 3, 2021
9df118c
Updated samples
cromefire Jan 3, 2021
6496460
Merge pull request #4 from fullkomnun/fix_request_response_collection…
cromefire Jan 4, 2021
cbcfae6
for json requests, by setting ContentType http header we can let Ktor…
fullkomnun Jan 4, 2021
4f983e6
no need for ApiClientBase to directly use serializer
fullkomnun Jan 4, 2021
d7744e2
allow initializing ApiClient by providing a custom HttpClient
fullkomnun Jan 4, 2021
6a30419
allow initializing ApiClientAsync by providing a custom HttpClient
fullkomnun Jan 4, 2021
796db72
Changed the async method to be Deferred<T> based
cromefire Jan 4, 2021
efcad7f
Merge remote-tracking branch 'origin/multiplatform-client' into multi…
cromefire Jan 4, 2021
648317d
Regenerated docs
cromefire Jan 4, 2021
d669434
Merge remote-tracking branch 'upstream/multiplatform-client' into sup…
fullkomnun Jan 4, 2021
f4468af
reuse 'createHttpClient' util in ApiClientAsync.kt.mustache
fullkomnun Jan 4, 2021
d348c5b
Merge pull request #9 from fullkomnun/support_more_flexible_api_clien…
cromefire Jan 4, 2021
c193251
Changed OffsetDateTime to be more like Java
cromefire Jan 4, 2021
776acb5
Made nested enum class value explicitly public
cromefire Jan 4, 2021
3ccbe12
Native ktor request building
cromefire Jan 5, 2021
4c88512
Fixed form data generation
cromefire Jan 5, 2021
7828e79
Added authentication to ApiClientBase
cromefire Jan 5, 2021
ea3e266
Added authorization configuration to ApiClientBase
cromefire Jan 5, 2021
ff6be13
Minor documentation improvements
cromefire Jan 5, 2021
ad4a0a2
Fixed issues with no auth
cromefire Jan 19, 2021
356c8d7
Merge branch 'master' into multiplatform-client
cromefire Jan 19, 2021
c750db0
Added configurable name to the ApiClient
cromefire Jan 19, 2021
cb87bd4
Finished authentication
cromefire Jan 19, 2021
39cafb6
Merge branch 'master' into multiplatform-client
cromefire Jan 28, 2021
bf318e3
Merge branch 'master' into multiplatform-client
cromefire Feb 5, 2021
66cbf0d
Removed explicit stdlib references
cromefire Feb 5, 2021
2d8becc
Merge remote-tracking branch 'origin/multiplatform-client' into multi…
cromefire Feb 5, 2021
9408010
Migrated general repo to maven central
cromefire Feb 5, 2021
b044c07
update multiplatform default kotlin version v1.4.21 -> v1.4.30
fullkomnun Feb 17, 2021
51a1261
update multiplatform default ktor version v1.4.1 -> v1.5.1
fullkomnun Feb 17, 2021
aada3f2
update multiplatform default gradle version v6.7.1 -> v6.8.1
fullkomnun Feb 17, 2021
8cce6fc
Update modules/openapi-generator/src/main/java/org/openapitools/codeg…
Feb 17, 2021
9dc74be
Merge pull request #11 from fullkomnun/update_kotlin_multiplatform_de…
cromefire Feb 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bin/configs/kotlin-multiplatform-new-async.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generatorName: kotlin-multiplatform
outputDir: samples/client/petstore/kotlin-multiplatform-new-async
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-multiplatform-client
jsEnabled: true
jvmEnabled: true
androidEnabled: true
async: true
dateLibrary: string
additionalProperties:
hideGenerationTimestamp: "true"
13 changes: 13 additions & 0 deletions bin/configs/kotlin-multiplatform-new-kotlinx-date.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
generatorName: kotlin-multiplatform
outputDir: samples/client/petstore/kotlin-multiplatform-new-kotlinx-datetime
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-multiplatform-client
dateLibrary: kotlinx
jsEnabled: true
jsAsync: none
jvmEnabled: true
jvmAsync: none
androidEnabled: false
iosEnabled: true
additionalProperties:
hideGenerationTimestamp: "true"
14 changes: 14 additions & 0 deletions bin/configs/kotlin-multiplatform-new.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
generatorName: kotlin-multiplatform
outputDir: samples/client/petstore/kotlin-multiplatform-new
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-multiplatform-client
jsEnabled: true
jsAsync: none
jvmEnabled: true
jvmAsync: none
androidEnabled: true
iosEnabled: true
nativeEnabled: true
dateLibrary: string
additionalProperties:
hideGenerationTimestamp: "true"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
generatorName: kotlin-multiplatform
outputDir: samples/openapi3/client/petstore/kotlin-multiplatform-new-kotlinx-datetime
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-multiplatform-client
dateLibrary: kotlinx
additionalProperties:
hideGenerationTimestamp: "true"
6 changes: 6 additions & 0 deletions bin/configs/other/openapi3/kotlin-multiplatform-new.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: kotlin-multiplatform
outputDir: samples/openapi3/client/petstore/kotlin-multiplatform-new
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-multiplatform-client
additionalProperties:
hideGenerationTimestamp: "true"
1 change: 1 addition & 0 deletions docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The following generators are available:
* [jmeter](generators/jmeter.md)
* [k6 (beta)](generators/k6.md)
* [kotlin](generators/kotlin.md)
* [kotlin-multiplatform](generators/kotlin-multiplatform.md)
* [lua (beta)](generators/lua.md)
* [nim (beta)](generators/nim.md)
* [objc](generators/objc.md)
Expand Down
220 changes: 220 additions & 0 deletions docs/generators/kotlin-multiplatform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
---
title: Config Options for kotlin-multiplatform
sidebar_label: kotlin-multiplatform
---

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.

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|androidGradleVersion|Sets the android gradle plugin version used| |4.1.0|
|apiClientName|Sets the name for the ApiClient class| |ApiClient|
|apiSuffix|suffix for api classes| |Api|
|artifactId|Generated artifact id (name of jar).| |kotlin-multiplatform-client|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|async|Add asynchronous methods for each endpoint with the help of Deferred&lt;T&gt;| |false|
|asyncSuffix|Sets the suffix added to the Deferred&lt;T&gt; based api clients, e.g. SomeApi&lt;suffix&gt;| |Async|
|dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String returns dates and times as string</dd><dt>**kotlinx**</dt><dd>Kotlinx multi-platform datetime library (experimental)</dd></dl>|string|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase|
|gradleVersion|Sets the gradle version used| |6.7.1|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|
|iosEnabled|Enables generation of core for ios in the multiplatform project| |false|
|jsBrowser|Add browser support to js module| |true|
|jsEnabled|Enables generation of core for js in the multiplatform project| |false|
|jsNode|Add nodejs support to js module| |false|
|jvmEnabled|Enables generation of core for jvm in the multiplatform project| |true|
|kotlinVersion|Sets the kotlin version used| |1.4.21|
|ktorVersion|Sets the ktor version used| |1.4.1|
|modelMutable|Create mutable models| |false|
|nativeEnabled|Enables generation of core for native in the multiplatform project| |false|
|packageName|Generated artifact package name.| |org.openapitools.client|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|sourceFolder|source folder for generated code| |src/main/kotlin|
|subproject|Generates a gradle subproject (without wrapper and settings)| |false|

## IMPORT MAPPING

| Type/Alias | Imports |
| ---------- | ------- |
|BigDecimal|java.math.BigDecimal|
|Date|java.util.Date|
|DateTime|java.time.LocalDateTime|
|File|java.io.File|
|LocalDate|java.time.LocalDate|
|LocalDateTime|java.time.LocalDateTime|
|LocalTime|java.time.LocalTime|
|Timestamp|java.sql.Timestamp|
|URI|java.net.URI|
|UUID|java.util.UUID|


## INSTANTIATION TYPES

| Type/Alias | Instantiated By |
| ---------- | --------------- |
|array|kotlin.collections.ArrayList|
|list|kotlin.collections.ArrayList|
|map|kotlin.collections.HashMap|


## LANGUAGE PRIMITIVES

<ul class="column-ul">
<li>kotlin.Array</li>
<li>kotlin.Boolean</li>
<li>kotlin.Byte</li>
<li>kotlin.ByteArray</li>
<li>kotlin.Char</li>
<li>kotlin.Double</li>
<li>kotlin.Float</li>
<li>kotlin.Int</li>
<li>kotlin.Long</li>
<li>kotlin.Short</li>
<li>kotlin.String</li>
<li>kotlin.collections.List</li>
<li>kotlin.collections.Map</li>
<li>kotlin.collections.Set</li>
</ul>

## RESERVED WORDS

<ul class="column-ul">
<li>as</li>
<li>break</li>
<li>class</li>
<li>continue</li>
<li>do</li>
<li>else</li>
<li>false</li>
<li>for</li>
<li>fun</li>
<li>if</li>
<li>in</li>
<li>interface</li>
<li>is</li>
<li>null</li>
<li>object</li>
<li>package</li>
<li>return</li>
<li>super</li>
<li>this</li>
<li>throw</li>
<li>true</li>
<li>try</li>
<li>typealias</li>
<li>typeof</li>
<li>val</li>
<li>var</li>
<li>when</li>
<li>while</li>
</ul>

## FEATURE SET


### Client Modification Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasePath|✓|ToolingExtension
|Authorizations|✗|ToolingExtension
|UserAgent|✗|ToolingExtension
|MockServer|✗|ToolingExtension

### Data Type Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Custom|✗|OAS2,OAS3
|Int32|✓|OAS2,OAS3
|Int64|✓|OAS2,OAS3
|Float|✓|OAS2,OAS3
|Double|✓|OAS2,OAS3
|Decimal|✓|ToolingExtension
|String|✓|OAS2,OAS3
|Byte|✓|OAS2,OAS3
|Binary|✓|OAS2,OAS3
|Boolean|✓|OAS2,OAS3
|Date|✓|OAS2,OAS3
|DateTime|✓|OAS2,OAS3
|Password|✓|OAS2,OAS3
|File|✓|OAS2
|Array|✓|OAS2,OAS3
|Maps|✓|ToolingExtension
|CollectionFormat|✓|OAS2
|CollectionFormatMulti|✓|OAS2
|Enum|✓|OAS2,OAS3
|ArrayOfEnum|✓|ToolingExtension
|ArrayOfModel|✓|ToolingExtension
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
|ArrayOfCollectionOfModel|✓|ToolingExtension
|ArrayOfCollectionOfEnum|✓|ToolingExtension
|MapOfEnum|✓|ToolingExtension
|MapOfModel|✓|ToolingExtension
|MapOfCollectionOfPrimitives|✓|ToolingExtension
|MapOfCollectionOfModel|✓|ToolingExtension
|MapOfCollectionOfEnum|✓|ToolingExtension

### Documentation Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Readme|✓|ToolingExtension
|Model|✓|ToolingExtension
|Api|✓|ToolingExtension

### Global Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Host|✓|OAS2,OAS3
|BasePath|✓|OAS2,OAS3
|Info|✓|OAS2,OAS3
|Schemes|✗|OAS2,OAS3
|PartialSchemes|✓|OAS2,OAS3
|Consumes|✓|OAS2
|Produces|✓|OAS2
|ExternalDocumentation|✓|OAS2,OAS3
|Examples|✓|OAS2,OAS3
|XMLStructureDefinitions|✗|OAS2,OAS3
|MultiServer|✗|OAS3
|ParameterizedServer|✗|OAS3
|ParameterStyling|✗|OAS3
|Callbacks|✗|OAS3
|LinkObjects|✗|OAS3

### Parameter Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Path|✓|OAS2,OAS3
|Query|✓|OAS2,OAS3
|Header|✓|OAS2,OAS3
|Body|✓|OAS2
|FormUnencoded|✓|OAS2
|FormMultipart|✓|OAS2
|Cookie|✗|OAS3

### Schema Support Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|Simple|✓|OAS2,OAS3
|Composite|✓|OAS2,OAS3
|Polymorphism|✗|OAS2,OAS3
|Union|✗|OAS3

### Security Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|BasicAuth|✓|OAS2,OAS3
|ApiKey|✓|OAS2,OAS3
|OpenIDConnect|✗|OAS3
|BearerToken|✓|OAS3
|OAuth2_Implicit|✗|OAS2,OAS3
|OAuth2_Password|✗|OAS2,OAS3
|OAuth2_ClientCredentials|✗|OAS2,OAS3
|OAuth2_AuthorizationCode|✗|OAS2,OAS3

### Wire Format Feature
| Name | Supported | Defined By |
| ---- | --------- | ---------- |
|JSON|✓|OAS2,OAS3
|XML|✗|OAS2,OAS3
|PROTOBUF|✗|ToolingExtension
|Custom|✗|OAS2,OAS3
Loading