81 Commits

Author SHA1 Message Date
Kirill Romanov
4e5a828c12
feat: add option to support non-ascii headers in kotlin client (#20331) 2024-12-15 16:46:42 +08:00
Alexander Brandon Coles
3a37ba33a7
Fix typo "bellow" (#20268)
* Fix typo in constant name: s/BELLOW/BELOW/

* Fix typo ('bellow') in docs, comments and strings
2024-12-06 16:18:08 +00:00
William Cheng
878148e66d
update kotlin option description to clarify the support (#20211) 2024-11-30 13:32:15 +08:00
Pavel Sveda
acb16410c4
[Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolve #16506) (#19999)
* [Kotlin] Properly document nonPublicApi CLI option

* [Kotlin] Respect parameter name of parent KSerializer to avoid miss-behavior

* [Kotlin] Introduce support for Kotlin Explicit API Mode for Kotlin-Client generator (resolves #16506)
2024-10-30 21:57:47 +00:00
Aliaksandr SEMIANKEVICH
e9c3c63732
[REQ] resolve #17544 Add x-field-extra-annotation and x-class-extra-annotation for kotlin generator (#19899)
Co-authored-by: Aliaksandr SEMIANKEVICH <aliaksandrsemian.epam@navan.tech>
2024-10-22 18:05:38 +08:00
Bruno Coelho
462f450366
[kotlin] Map file and binary to ByteArray (#19840)
* [kotlin] Map file and binary to ByteArray

* [kotlin] Map file and binary to ByteArray
2024-10-11 08:59:16 +01:00
Eric
425aa7db44
[Kotlin] Add a new additional property to configure Jackson's failOnUnknownProperties (#19506)
* [Kotlin] Add a new additional property to configure Jackson's `failOnUnknownProperties`

Default to false

* [Kotlin] Unconditionally import `com.fasterxml.jackson.databind.DeserializationFeature`

* [Kotlin] Refactor and add test
2024-09-16 17:59:17 +08:00
William Cheng
353320cb04
[kotlin] better oneOf, anyOf support (#18382)
* add validteJsonElement

* add oneOf support

* various fixes, add tests

* minor fixes

* minor fixes

* update data class

* remove comments

* array support, add test

* update api client constructor

* add anyOf support

* add new files

* fix merge

* update

* update

* update

* update
2024-05-31 12:22:27 +08:00
William Cheng
494fc7d182
[kotlin] Enum should match spec (#18062)
* [kotlin] Enum should match spec

Adjust the enum generation to match what is in the spec, rather than
camel-casing it.
Add tests for capitalization scenarios, including for kotlin keywords

* [kotlin] export docs generators for enum change

* [kotlin] export docs generators for enum change

* fix conflicts

---------

Co-authored-by: Tyler B. Thrailkill <tylerbthrailkill@gmail.com>
Co-authored-by: Jari Nystedt <jari.nystedt@tietoevry.com>
2024-03-09 17:42:33 +08:00
William Cheng
7d539bcb78
Remove deprecated library (jvm-okhttp3) in kotlin client generator (#17884)
* remove deprecated library in kotlin client generator

* update workflow
2024-02-18 17:16:23 +08:00
Tiffany Marrel
42f72192ca
add security feature AWSV4Signature to documentation (#15603) 2023-12-13 15:07:18 +08:00
Stefan Koppier
7f05c1f41d
[kotlin-client] New generator: kotlin-jvm-spring-restclient (#17366)
* Created kotlin jvm spring restclient

* Fixed kotlin jvm-spring-restclient

* Fixed earlier problems

* Fixed earlier problems

* Updated kotlin.md
2023-12-11 12:49:36 +08:00
Csaba Kozák
ab0b44a1c4
[kotlin-client] add support for kotlinx-datetime (#17166)
Closes #14490
2023-11-22 17:52:37 +00:00
William Cheng
29c5d6109a
mark java-okhttp3 option as deprecated in kotlin client (#16272) 2023-08-08 10:05:52 +08:00
Clément Tamisier
a22a7c0d83
[kotlin-spring] Add missing parameter 'nullableReturnType' in docs (#15952) 2023-07-02 23:16:19 +08:00
Tiffany Marrel
d3a2e0e43e
[Kotlin] fix security features listed in documentation (#15758) 2023-06-06 10:45:44 +08:00
Clément Tamisier
2b9d94cb0a
add missing quote (#15732) 2023-06-03 13:36:13 +08:00
Stefan Koppier
b3b672fdfc
[Kotlin-client][jvm-spring-webclient] Added support for spring boot 3 (#15646)
* Bumped kotlin spring-jvm-webclient spring boot version from 2.7.11 to 3.1.0

* Do not redefine HttpHeaders and MediaType for simpler code

* Added a simpler constructor to the api and simplified encodeURIComponent

* Added support for Spring Boot 3 in kotlin-client jvm-spring-webclient generator

* Fixed small syntactical regression in Kotlin client build.gradle
2023-05-26 17:07:36 +08:00
William Cheng
4c7963cf54
remove deprecated options in kotlin client generator (#15651) 2023-05-26 14:51:55 +08:00
Stefan Koppier
9358ab9d1d
[kotlin] New 'jvm-spring-webclient' library (#15568)
* Added library 'jvm-spring-webclient' to Kotlin client generator

* Reran all generators and generated docs

* Changed target of kotlin-jvm-spring-webclient sample from 2_0 to 3_0

* Added build of kotlin-jvm-spring-webclient to github workflow
2023-05-23 11:34:52 +08:00
Tiffany Marrel
00676870a3
add HTTP signature to SecurityFeature (#15542) 2023-05-17 00:48:58 +08:00
Dylan Kwon
83ccfb820c
Added useSettingsGradle property in kotlin-client. (#15003)
* Added useSettingsGradle property in kotlin-client.

* kotlin docs update.
- add kotlinx_serialization in serializationLibrary.
2023-03-21 11:45:35 +00:00
Antti Leppä
11c43c3c2b
Added Kotlin Vert.x client (#13594)
* Initial version of Kotlin Vert.x client

* Initial version of Kotlin Vert.x client

* Initial version of Kotlin Vert.x client

* Fix for parseDateToQueryString issue in vert.x kotlin client

* Moved common methods from api to ApiClient in kotlin vert.x client

* Fixed issue with absolute URLs

* bearer auth for oauth

* empty request headers fix

* missing import and typo

* added uri template dependency

* added api abstractions to client generator

* added full import form infrastructure

* removed fail on unknown properties to response body parsing

* fixed error response parsing

* replace vertx client name to more unique

* multiline content type

* optional responses added to template

* additional annotations for kotlin client

* Added additionalModelTypeAnnotations parameter support to AbstractKotlinCodegen

* Updated samples and documents

* Fixed issues with gson and moshi serializers with kotlin-jvm-vertx client

* Added sample configs for kotlin-jvm-vertx clients with gson, jackson and moshi

* Added samples for kotlin-jvm-vertx clients with gson, jackson and moshi

* Included kotlin-jvm-vertx samples to test build

* Updated samples

Co-authored-by: Katja Danilova <katja.danilova@protonmail.com>
2022-10-19 22:29:34 +08:00
y-tomida
5644e23128
[Kotlin] Add reserved word contract (#13108) 2022-08-07 09:50:47 +01:00
anttikarhu
05ae49698f
Idea plugin for marking source directories, and omitting gradle wrapper (#12711)
* Idea plugin for marking source directories, and omitting gradle wrapper for creating sub projects

* Register the omitGradleWrapper option

* Added missing idea option
2022-06-28 16:06:10 +01:00
William Cheng
b02fd28ba6 update doc 2022-05-05 01:11:35 +08:00
Sergey Vladimirov
6bd7036ff8
[kotlin-client] Add ktor library with Jackson and GSON processing support (#11838) 2022-05-05 00:50:45 +08:00
Justin Black
e2e7609bac
Adds not to CodegenComposedSchemas and uses it in python-exp (#12146)
Updates docs
2022-04-17 09:36:09 -07:00
Justin Black
eef7cddd6f
Adds UUID to python-experimental (#12153)
* Adds UUID to python-exp, allows uuid models to be generated

* Adds test_UUIDString uuid model test

* Fixes uuid properties in python-exp, changes maps to object data type, adds uuid data type

* Adds maps data type back in

* Adds missing Null and AnyType definitions and adds them to python-experimental

* Generator docs updated, added missing uuid, null, anytype, and object

* Adds uuid support description

* Docs updated
2022-04-16 14:55:49 -07:00
Slawomir Kwasniak
0e4eb50af2
Fix typo in supportAndroidApiLevel25AndBelow help (#11821)
Obvious typo in the kotlin help description of the
`supportAndroidApiLevel25AndBelow` configuration parameter i.e.
`in oder` instead of `in order`.

Co-authored-by: Slawomir Kwasniak <slawomir.kwasniak@hensoldt-cyber.de>
2022-03-09 00:01:23 +08:00
Armel Soro
ed14ce4dec
[Kotlin] Use mutable container types when 'modelMutable' is enabled (#11154)
* [Kotlin] Use Mutable container types when 'modelMutable' is enabled

* Generate sample 'kotlin' project with mutable models

* Generate sample 'kotlin-server' project with mutable models

* Generate sample 'kotlin-vertx' project with mutable models

* Generate sample 'ktorm-schema' project with mutable models

Co-authored-by: Bruno Coelho <4brunu@users.noreply.github.com>
2022-01-30 12:06:03 +00:00
Justin Black
78f4748c06
Adds generator default template engine (#11366)
* Revert "Revert "Has generators set default template engine (#11245)" (#11316)"

This reverts commit 57987424a4eaa22d73337388489cd86d7f42a023.

* Only loads in the default template engine if the config file contains the generatorName

* Only sets templatingEngineName using condif default in one place

* Adds config files that lack generatorName

* Revert "Adds config files that lack generatorName"

This reverts commit 7dafc93c0f02c037d9be5d2c0a3ee7377c8b479d.

* Adds generator default templating engine to the generator metadata
2022-01-23 14:16:46 -08:00
Justin Black
de036e211e
Improves generator docs: stability + language version added (#11270)
* Adds generatorLanguageVersion and uses it in python generators

* Regenerates docs

* Adds stability to generator docs

* Triple braces generatorLanguageVersion

* Regenerates samples

* Fixes the python-experimental setup.py file so it works with generatorLanguageVersion

* Updates generators readme
2022-01-10 18:16:53 -08:00
Justin Black
0eca629127
Adds generatorLanguage to all generators (#11268)
* Adds generatorLanguage to all generators

* Adds all generator languages and info to docs

* Docs updated
2022-01-10 12:13:35 -08:00
Justin Black
d813d04f46
Improves generator docs, adds metadata section (#11262)
* Refactors generator md creation, adds generateMdMetadata

* Removes extra space

* Adds docs updates

* Fixes table definition for metadata

* Docs update

* Docs update

* Updates title, removes sidebar_label because it was not doing anything on pages like https://openapi-generator.tech/docs/generators/android

* Docs updated
2022-01-09 14:10:47 -08:00
alisters
0de482da2b
Kotlin client: add volley library support (#10253)
* Add basic jvm-volley folder to enable it as a library

* Add JVM_VOLLEY to the KotlinClientCodegen as a library option (using Retrofit2 processing for now)

* Temporary checkin of generated code and kotlinfied version for use in new template

* Added Kotlin-ified api invoker and request objects, update Kotlin client codgen for volley

* Add Android specific build.gradle mustache file to jvm-volley library

* Hardcode SDK version and build tools version in build.gradle template, add extra repository for Android Gradle build tools

* Add Android manifest to generated code

* Add Kotlin dependencies and plugins to build gradle template

* WIP: Create basic API templating for jvm-volley

* Add ApiException and parameter validation, create path variable using ApiInvoker

* Build queryParams and headerParams

* Add VolleyRequest template

* WIP: Injecting context and default API invoker into APIs (non compiling)

* Add DefaultInvoker stub and update API to inject context

* Add request queue generation to the DefaultInvoker

* Fix up compile errors in the invoker

* Cleanup unrequired templates

* Update templates

* Add constructor overloads to inject stack or network into request queue

* Fix compile errors with request queue generation

* Fix compile errors

* Al'll fix it for you.....

* WIP compile fixes

* More compile fixes

* Generate to java directory and kotlin-ify auth code

* More syntax fixes in templates

* Almost left it in a working state, fixing that .... now...

* Switch builder method based on model existence constraints - body and response

* Add coroutine logic to APIs and pass through listeners to the requests, various other fixes.

* Use reflection and type tokens to work around clazz issues on generics

* Add POST, PATCH and PUT to RequestFactory

* More templating magic

* Fix Steve, the human compiler's errors again !

* Add CLI option for generating room models

* Configure the room model package

* Add initial room model templating and generation

* Add room model generation implementation

* Implement toRoom function on models to convert model to room model

* Bug fixes, transformers to and from room models

* Add query parameters to URL generation

* Fix issues with gson type conversion, add type adapters to gson instance

* Fix issues with older API versions and Java8 libraries,

* Add request factory interface

* API template tidy up

* Update IRequestFactory to include companion object, minor tidy ups

* Remove @Keep annotations from room templates

* Rename toRoomModel and toApiModel functions

* Add empty companion object to generated room model

* Add ITransformStorage interface to allow polymorphic transforms to room models

* Add content type into GsonRequest

* Move gson serialization of request body into GsonRequest

* Update request factory to take header factories

* Remove the generated comparision code

* Move the generateRoomModels switch into the KotlinClientCodegen class

* Move room model generation out of default generator

* Updates for auth

* Finalise removal of kotlin elements from default generator

* Hoist room model logic out of abstractKotlin into kotlin client codegen

* Revert AbstractKotlinCodegen

* Revert Codegen constants to remove base generator changes out of our new library

* Revert data class template changes, add data class body check to Kotlin Client codegen

* Add sample generation yaml file for jvm-volley library

* Update JVM-Volley readme for generateRoomModels flag

* Remove unused template files, get auth compiling but non functional, clean build of warnings

* Generate sample generated code

* Add not implemented method for oauth

* Add unit test for KotlinClientCodegen generateRoomModel flag

* Remove accidental hard coding of src/main/java source folder

* Push changed generated sample files

* Move and rename IStorable inside the volley library

* Inject retry policy into API definition, re-run sample and doc scripts

* Add generic post processors

* Update samples after generator changes

* Fix some compile errors with the pet store sample

* Fix duplicate auth companion object and import generation

* Reinstate query and form parameter code generation

* Add check for unsupported serialization libraries

* Fix broken unit tests

* Regenerate samples

* AN-233 Update request factory to allow custom gsonadapters

* update `GsonRequest.mustache` and `RequestFactoy.mustache` to use `Map<Type, Any>` instead of `Map<Type, Object>` to better fit kotlin conventions

* Update readme with better examples and design notes

* Update readme with info about gson serializers and adapters for polymorphic types

* Updated samples

* Merge from upstream

* Address review comments

* Update samples

* Samples

* Update docs

* Remove DateAdapter generated file, template and it's inclusion as a supporting file in favour of localDateTime

* Review comment cleanup for initial PR #10253 - cleaner auth key in parameter string handling

* Review comment - add a kotlin version parameter to the build scripts

* Updated samples

* Missing changes from build.mustache

* Regenerate samples for build.gradle changes

* Merge from master and generate samples

* Remove serializer as a supporting file from jvm-volley - it's serialisation is not a singleton and configured differently via gson request and dependency injection

* Remove singleton serializer from jvm-volley generation as it's not used

Co-authored-by: Alister Shipman <alister.shipman@greater.com.au>
Co-authored-by: Steve Telford <steven.telford@greater.com.au>
Co-authored-by: Leigh Cooper <leigh.cooper@greater.com.au>
Co-authored-by: Michael Hewett <y2trooper@gmail.com>
2021-12-20 14:59:11 +08:00
William Cheng
fbb61658df
[kotlin][client] rename ApiInfrastructureResponse to ApiResponse (#11094)
* rename ApiInfrastructureResponse to ApiResponse

* mark ApiResponse as reserved word

* update samples, docs

* fix typo
2021-12-12 16:32:08 +08:00
Tal Kirshboim
ae911ff2c1
Support generated gradle module as child module (#10966) 2021-11-27 09:36:19 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
William Cheng
ec49dc3fed
[Kotlin] minor bug fixes (#10071)
* fix http basic auth, deprecate option, escape special property name

* update doc
2021-08-02 18:04:38 +08:00
Noor Dawod
e39e4bcd6e
Kotlin client/spacings indentations (#9853)
* Bump jimschubert/query-tag-action from 1 to 2

Bumps [jimschubert/query-tag-action](https://github.com/jimschubert/query-tag-action) from 1 to 2.
- [Release notes](https://github.com/jimschubert/query-tag-action/releases)
- [Commits](https://github.com/jimschubert/query-tag-action/compare/v1...v2)

Signed-off-by: dependabot[bot] <support@github.com>

* Adjust spacings, bring back suppresses to silence IntelliJ IDEs.

* Suppress few warnings since we know we are using them in the code.

* toLowerCase() is deprecated.

* Wrap enum values in backticks to guard against reserved names, bring back encode/decode for each enum.

* Wrap property names in backticks to guard against reserved names.

* Regenerate samples.

* Do not warn about unused imports.

* Regenerate samples.

* Updated petstore code.

* Add missing reserved Kotlin operators and special keywords.

* Revert adding backticks.

* Regenerate pet store shop code.

* Remove unused suppression.

* Use 3 braces to wrap name.

* Regenerate pet store shop code.

* Remove get from reserved words.

* Revert back removal of description.

* Regenerate source code for Petstore.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-02 17:38:22 +08:00
Matthias Ernst
17b6379df5
[Kotlin Multiplatform] Update and fixes for Kotlin 1.5.10 and Kotlinx.serialization 1.2.1 (#9755)
* Update Kotlin Multiplatform with Kotlin 1.5.10, Ktor 1.6.0 and Kotlinx.serialization 1.2.1
* remove @Serializable from interfaces
* Using 'String(CharArray): String' is an error. Use CharArray.concatToString() instead
* Fix, RequestConfig needs a type to infer type variable T

Fixes from @DevSrSouzaern
* Fix `private` keyword not being handle as a reservedWords
* Fix enum serialization generation
* Migrate gradle build to Kotlin DSL

* update samples and documentation

* PR Review changes
* sample update
* revert non multiplatform kotlinx_serialization removal
* default Json{} in ApiClient
* revert accidental version push for jvm client
* Match ktor and Kotlinx Serialization version in documentation and build.gradle.kts

* remove const from JSON_DEFAULT

* Update AbstractKotlinCodegen.java

Co-authored-by: Gabriel Souza <devsrsouza@gmail.com>
Co-authored-by: ern <ern@ti8m.ch>
2021-07-03 23:33:39 +08:00
Adriaan Duz
147367e559
[Kotlin][Bug] Added open, external and internal as reserved keywords for kotlin (#9842)
* Added open, external and internal as reserved keywords for kotlin

* ./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh
with only kotlin
2021-07-01 17:54:04 +08:00
Bruno Coelho
163d13e415
[kotlin][client] fix Android crash on API level 25 and bellow (#9578)
* [kotlin][client] fix Android crash on API level

* [kotlin][client] update sample project

* Try to fix CI

* [kotlin][client] add flag to control android api level supported

* [kotlin][client] update docs

* [kotlin][client] update docs
2021-05-26 18:24:52 +08:00
Bruno Coelho
3173e0b1d3
[kotlin][client] improve docs (#9393) 2021-05-10 20:42:13 +08:00
Bruno Coelho
45fc02350b
[kotlin] fix Date types usages (#8594)
* [kotlin] fix Date types usages
2021-02-02 20:55:51 -05:00
Christophe Bornet
ca3fcd882e
[Kotlin] Fix Spring Kotlin generation of array/map models (#7829)
* Fix Spring Kotlin generation of array/map models

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-10-31 17:38:37 +08:00
Jim Schubert
d854c89272
[docs] Add clarity around configuration options (#7547) 2020-09-30 20:56:28 -04:00
tgerth
66cd0f6511
[Kotlin] Rxjava3 support (#6998)
* added rx3 support

* fix rx3 support

* generated samples

* updated samples

* update samples

* changed rxjava3 adapter to the one from squareup

* changed dependency of RxJava3CallAdapterFactory

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-04 16:58:27 +08:00
Yuriy Belenko
f11b0f886e
Add Mock Server client modification feature (#6747) 2020-07-05 16:58:43 -04:00