82 Commits

Author SHA1 Message Date
Yuriy Belenko
f11b0f886e
Add Mock Server client modification feature (#6747) 2020-07-05 16:58:43 -04:00
Nikita Karnaukh
53eff43184
[Kotlin][Client] Fix url path for Retrofit, Fix optionals for @Query @Body, Set List as default collection for Kotlin data class (#6456)
* Replace typeMapping kotlin.Array with kotlin.collections.List, because its doesn't work with Kotlin Data Classes(required manually implementing  hashCode&equals)
Replace typeMapping kotlin.Array<kotlin.Byte> with efficient primitive implementation kotlin.ByteArray
Replace instantiationTypes array to kotlin.collections.ArrayList, for extending Array we should provide element count to its constructor.

* Fixed path(removed slash on begin path) for Jvm Kotlin Retrofit

* Fixed handling optional bodyParams for Jvm Kotlin Retrofit

* Fix kotlin tests

* Fixed code format for detekt inspections #2

* revert formatting

* Added ability to generate optional @Query params.

* Update Kotlin docs.

* Update Kotlin openapi3 client samples

* Update Kotlin client samples

* Update Kotlin openapi3 client samples after merge with master

* Revert hardcoding List instead Array

* Set List as default collectionType

* Update Kotlin samples

* Fixed Kotlin multiplatform api template. fix mapper for Array type.
Fixed Kotlin multiplatform api template Code style.

* Update Kotlin multiplatform sample

* Fix Kotlin multiplatform template code style

* Update Kotlin multiplatform sample

* Fix Kotlin multiplatform converting Array to List in Api.

* Update Kotlin multiplatform sample #3

* Fix Kotlin tests

* Fix Kotlin jackson Application.kt

* Fix Kotlin tests #2

* Fix merge conflict with master

* Generate samples after merge with master

* Generate samples after merge with master #2

* Generate samples after merge with master #3

* Generate samples after merge with master #4

* update kotlin samples

* update all samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-16 10:33:34 +08:00
Nikita Karnaukh
eefcd62d5b
[Kotlin][Client] Added supporting Retrofit2(RxJava/RxJava2/Coroutines) (#5750)
* Added support Retrofit2(RxJava/RxJava2/Coroutines) to Kotlin client code generator

* Added generated samples for Retrofit2(RxJava/RxJava2/Coroutines) on Kotlin

* Fixed generating retrofit2 without Rx/Coroutines

* Fixed MultipartBody template, remove redundant space after MultipartBody.Part annotation

* Fix documentation diff.

* Fix generating build.gradle file for samples.
Add dependencies for rxJava/rxJava2 and rx retrofit's adapter.

* Update generated sample with rx dependencies

* Update generated sample with coroutines

* Update generated sample with RxJava 2 dependencies

* Update and refactoring scripts for sample generation

* Update generated sample code

* revert changes by mistake

* revert changes by mistake #2

* Fix return type for first RxJava

* Add RxJavaCallAdapterFactory to ApiClient scheme for RxJava 1/2

* Fix script loggin

* Update generated code for RxJava 1/2

* Fix kotlin.md documentation by script export_docs_generators.sh

* Update Kotlin samples project in pom.xml

* Revert "Update Kotlin samples project in pom.xml"

This reverts commit 9de4d0ba

* Fixed "" wrapping number types for annotation value
Fixed generating polymorphic interfaces for Gson, interface fields can't be marked with @SerializedName annotation, it's enough to mark it in child model.
Fixed instantiationTypes(array, list, map) for Kotlin generator

* Update Kotlin samples project after last fixes

* Update Kotlin samples project for kotlin-jvm-*

* Update Kotlin readme.md documentations

* Update Kotlin client sample changes

* Fixed encoding braces for generics model

* Update Kotlin client sample changes

* Update Kotlin client sample after merge with master

* Fixed adding empty braces for inherit from Map/Array

* Update sample model after last fix with empty braces

* Revert adding @SerializedName to Kotlin interface fields through @get:SerializedName as for Jackson

* Update Kotlin client samples with adding @get:SerializedName
2020-05-18 16:26:27 +08:00
Herve DARRITCHON
f6ef4fbec7
[kotlin][client] Add Jackson as serialization library (#5236)
* [kotlin][client] Add Jackson as serialization library

* [kotlin][client] Add kotlin-client-jackson.sh to kotlin-client-all.sh

* update kotlin client samples

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-02-25 23:41:09 +08:00
Jim Schubert
aa7cd4f5af
[docs] Upgrade to Docusaurus 2 (#5271)
* [docs] Upgrade to Docusaurus 2

Due to formatting issues with Docusaurus 1 and code blocks, and upcoming
4.3 and 5.0 releases, this is an upgrade to have more control over
formatting and other functionality.

This adds behavior to have light/dark themes.

As a consequence of upgrading, columnar format on ul element in
generated generator docs had to be moved to css. This will not impact
users viewing the markdown on GitHub because it didn't display the
column format.

This upgrade should improve syntax highlighting and performance.

* Fix user page layout, choose theme with clear diff colors
2020-02-11 21:22:58 +08:00
Jim Schubert
a496c2011f
[docs] Initial FeatureSet generator documentation (#5188)
* Flatten feature sets for display

* [cli] Add feature set output to config-help

This includes markdown and plain text outputs for config-help.

* [docs] FeatureSet on generator docs
2020-02-01 20:51:55 -05:00
William Cheng
04af5e0445 Merge remote-tracking branch 'origin/master' into 4.3.x 2020-01-20 15:04:34 +08:00
Jim Schubert
644f720db8
[docs] Sorted doc outputs and clean up duplicated CliOptions (#5046)
* [config-help] Sort all outputs

* Remove old/stale generator docs (these have been renamed previously)

* Sort config doc outputs, making it easier to find relevant info

* Fixes cliOptions duplicates

Erlang client/proper improperly set the version option as packageName
(causing duplicate for packageName).

The java and swift option removals are because the options are added in
parent classes, resulting in duplication of the options.

* Add --github-nested-index for generating docs/generators/README.md

* 📝 Regenerate generator docs
2020-01-19 20:19:11 -05:00
Jim Schubert
a2532cc3c5
[doc] full generator details (#4941) 2020-01-08 21:54:05 -05:00
Bruno Coelho
9d53ee4b69 [kotlin][client] make Request date converter toJson as default (#4884)
* Fix for Issue #2205

Because when we have tags on OpenAPI Specification, there can be more than 1 Feign Beans being generated and the title field is share by all the clients. This makes the code to stop working in runtime.
Here is a PR which uses the classVarName instead, which follows the standards and should be enough to solve this issue.

For more info please refer to: https://github.com/OpenAPITools/openapi-generator/issues/2205

* fix java feign parameter request name (#4883)

* update sprign cloud feign sample

* [JAVA][SPRING][2195] added missing getter for enum value (#2346)

* [2195] added missing getter for enum value

* updated samples

* re-generate spring samples

* Removed @JsonValue from toString and regenerated samples

* re-generate spring samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* update samples

* [kotlin][client] make Request date converter toJson as default

* [kotlin][client] update windows scripts

* [kotlin][client] update docs

* [kotlin][client] update scripts

* [kotlin][client] update scripts

Co-authored-by: Filipe Manuel Couto Pinheiro <filipemcpinheiro@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Lukáš Vasek <bilaak@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-01-02 13:46:49 +08:00
Bruno Coelho
3eaafce569 [kotlin][client] Use OffsetDateTime to represente date-time received by the server (#4835)
* [kotlin] add OffsetDateTime support

* [kotlin] serializer add missing import

* [kotlin] update pet projects and fix tests

* [kotlin] update docs

* [kotlin] update pet projects

* [kotlin] update date-time

* [kotlin] update pet project

* [kotlin] update windows script
2019-12-20 23:20:02 +08:00
Bruno Coelho
56f298a0b4 [kotlin][client] unify jvm libraries (#4827)
* [kotlin] unify jvm envirement

* [kotlin] rename retrofit2 to jvm-retrofit2

* [kotlin] update retrofit2 bat script

* [kotlin] update docs

* [kotlin] update docs

* [kotlin] update pet projects
2019-12-20 18:25:07 +08:00
Bruno Coelho
265ad2297b [kotlin] add options sortParamsByRequiredFlag and sortModelPropertiesByRequiredFlag (#4707)
* [kotlin] add option to sortParamsByRequiredFlag

* [kotlin] add option to sortParamsByRequiredFlag

* [kotlin][client] sort parameters in the models

* [kotlin] update docs

* [kotlin][client] simplify sortParamsByRequiredFlag implementation

* [kotlin] experiment with sortnmodel properties by name

* [kotlin] introduce sortModelPropertiesByRequiredFlag

* [kotlin] update docs

* [kotlin] update kotlin

* [kotlin] fix tests

* [kotlin] update docs

* Revert "[kotlin] update docs"

This reverts commit 88ad825de5b4c090fe04398bdfde2e9d3252742f.

* [kotlin] update docs and petstores

* [kotlin] update docs

* [kotlin] update pet projects
2019-12-20 17:42:48 +08:00
William Cheng
4ee610c857 update doc 2019-12-19 00:19:21 +08:00
Javier Luque Sanabria
bb4af91bbd Feature/kotlin/library/retrofit (#4518)
* Some clean code.

* Add support for retrofit2 in models and apis. Need work in ApiClient, but it's not urgent.

* Add ApiClient with retrofit2 support.

* Remove unnecessary package.

* Add scripts to generate samples.

* Generate sample of retrofit2

* Change toUpperCase to toUpperCase(Locale.ROOT) to fix compile.

* Added GSON library when it's needed

* Fix typo.

* Add some missing common files.

* Execute bin script.

* Remove copy&paste error in script.

* [kotlin] update outdated files

* Fix apis with no params.

* Add missing import in ApiClient

* Add support for CSV, SSV, TSV, PIPES, SPACES in retrofit 2 library.

* Fix package name.

* Execute kotlin-client-retrofit2.sh script.

* force rebuild.

* execute script again.

* Add missing imports from okhttp3.
@Deprecated has a message param that java not. Add it with a default message.

* Execute retrofit2 script.

* Rerun script.
2019-12-15 18:26:37 +08:00
Thibault Duperron
2dc0220874 Add mutable model option to kotlin generators (#4115)
* Add mutable model option to kotlin generators

fix #3803

* doc

* Change template name to modelMutable

* Samples
2019-11-27 18:04:43 +08:00
William Cheng
56c38904fb update doc 2019-11-23 11:14:18 +08:00
William Cheng
a1fc114efa
[Swift] minor fix to scripts (#4577)
* minor fix to swift4 scripts

* fix script

* update bitrise config

* update doc

* run swift4_test_all.sh directly

* make swift4 script executable
2019-11-22 21:42:32 +08:00
Jim Schubert
0e1ce6bb63
[docs] Custom template clarifications and other minor enhancements (#4167)
* [docs] Updating docsite outputs to be browsable on Github as well

* Fix links to other files
   Suffix `.md` was needed to make links works

* [docs] Add clarification to differences between customization and templating docs

* [docs] Collapsible side bar, scroll to top, minor enhancements
2019-10-16 18:04:44 -04:00
William Cheng
0d91be3a72 update petstore samples 2019-10-10 10:27:13 +08:00
William Cheng
e9a0a51b50
Fix file type in avro template (#4105)
* fix file type in avro template

* update doc
2019-10-09 20:22:57 +08:00
Jan
bbfcd3bf64 [kotlin-client][kotlin-server] Feature/kotlin data class serial version uid (#4021)
* feat: add companion object to data classes if the implement the interface java.io.Serializable

* style: format template file

* style: adapt to project's original code style

* fix: add missing imports

* style: reverted mustache template to original styling

* test: generate additional samples for kotlin-springboot-reactive and kotlin-springboot

* docs: name full qualified classname of interface java.io.Serializable to prevent confusion with kotlinx.serialization
2019-10-09 15:17:53 +08:00
Jan
baa53cbf57 [kotlin-client][kotlin-server] feature: allow creation of kotlin data classes that implement java.io.Serializable (#3997)
* feat: allow creation of kotlin data classes that implement java.io.Serializable, by adding the config option serializableModel=(true|false)

* docs: add markdown docu for new configOption serializableModel

* fix: do not use parcelize in script

* update kotlin samples

* add the option, update the doc
2019-10-02 00:13:00 +08:00
Andrew Emery
21e0e0d5d5 Kotlin multiplatform client (#3900)
* Includes Kotlin multiplatform client

Kotlin multiplatform allows Kotlin code to be shared across various target platforms.
This implementation generates Swagger clients for JVM and iOS platforms.

* Includes Kotlin Multiplatform sample scripts

* Updates existing Kotlin samples

* Includes Kotlin Multiplatform samples

* Fixes incorrect Windows sample resource location

* Updates Kotlin client documentation

* Removes unnecessary workaround to remove duplicate entries

* Includes additional multiplatform type and import mappings

* Fixes Kotlin client definitions with multiple enums

https://github.com/OpenAPITools/openapi-generator/issues/3917

* Updates Kotlin samples
2019-09-21 21:48:41 +08:00
prisoneroftech
8f7e43b500 [Kotlin][client] Support gson and moshi as serialization libraries (#3734) 2019-08-29 05:37:13 +02:00
Vincent Devos
ef26ce68d4 [Kotlin] client improvement / remove WildCards in client/server (#2862) 2019-05-11 11:42:11 +08:00
fj-roman
7eb2be9c99 [Kotlin] add apiSuffix configuration (#2690)
* add apiSuffix configuration

* Add default value for Api suffix

* remove overriding method toApiName

* refactor the global option apiSuffix to kotlin specific feature

* add missing Option for apiSuffix

* extend readme.md for apiSuffix configuration

* update doc

* add testcase
2019-05-07 21:37:32 +08:00
Jim Schubert
6fe9a52229 [feat][docs][website] Initial docusaurus based site (#1770)
* Iniital docusaurus based site

* Remove error about default local being used by String.format

* Change pinned users to represent global presence rather than alphabetical order pinning

* Include generator indexes in ensure-up-to-date (docusaurus site and /generators/README)

* Add Font Awesome attribution footer

* Remove feature callout until it is completed

* Include NPM try it out section

* Improve "Getting Started" type docs

* Include new custom template documentation

* Updating templating and customization docs

* Add vendor extension docs

* Cleanup templating page(s).

* Move users to yaml file for easy edit.

* travis configuration, and baseUrl mods to image URLs

* [docs] Migrate FAQ, release summary  from wiki

FAQ has been split into multiple smaller documents to better categorize
and allow users to find what they're looking for (in docs folder or in
new website).

Release summary information (versioning strategy and cadence) has been
migrated from the Wiki and clarified a bit.

Also adds copy button for all code snippets in website.

* Copy current contributing/code of conduct to website

* [docs] Creating a new generator
2019-01-18 17:39:33 +08:00
Simas Abramovas
777bf1f3aa Kotlin collection type (#1564)
* Allow specifying type

* Add test

* Update docs

* Don't modify types if the default option is chosen
2018-11-29 10:33:55 +08:00
Simas Abramovas
f802e63f9f Add parcelizeModels cli option (#1289)
* Add parcelizeModels cli option

* Add info log to clarify the parcelization requirements.

* Update docs
2018-11-09 23:51:27 +08:00
William Cheng
d8957af76b
Update generator option (#1236)
* update generator option

* update kotlin option usage

* update lua option

* update wording for lua option
2018-10-16 23:05:14 +08:00
Jérémie Bresson
31149a5a69
Publish documentation for the generators (#932) 2018-08-31 16:00:27 +02:00