743 Commits

Author SHA1 Message Date
Guillaume TOURBIER
9ece1b5111
[Java] refactor: improve additionalModelTypeAnnotations generation (#8269)
* refactor: improve additionalModelTypeAnnotations generation

Split by ';' and/or newline
Trim value

fix: #7032

Run ./bin/generate-samples.sh to regenerate model files

Revert "Run ./bin/generate-samples.sh to regenerate model files"

This reverts commit da509c39f363da046fbd457e1ab67ef0f62f3561.

refector: remove unnecessary import

test: multiples tests for AdditionalModelTypeAnnotations

Add a getter to test the list

refactor: remove duplicate AdditionalModelTypeAnnotations

Without using Set to avoid any side effect somewhere, I use stream and
distinct to avoid duplicates

refactor: using Set instead of stream

Remove stream distinct for performance reason, use newHashSet
Keep AdditionalModelTypeAnnotations as List

doc: update info additionalModelTypeAnnotations

refactor: move doc in code for autogen

style: tab in java class

doc: run ensure-up-to-date

refactor: add imports lost in rebase

docs: regenerate docs

docs: update

* fix: docs
2021-08-17 18:10:19 +08:00
William Cheng
87554ecb2d
[java][micronaut] minor improvements (#10158)
* mark java micronaut generator as beta

* update doc
2021-08-16 12:04:42 +08:00
William Cheng
74671fa242 update doc 2021-08-15 23:02:36 +08:00
Andriy Dmytruk
09aa7bfd0a
Add support for Micronaut Client (#10063)
* Create initial version of openapi micronaut generator

* Update validation, authorization, query parameters and time format

* Move micronaut to its own generator

* Add micronaut documentation

* Refactor and add tests to JavaMicronautClientGenerator

* Refactor model mustache for micronaut client

* Refactor model enum and pojo mustache files for micronaut client

* Move micronaut client generation to micronaut 3.0.0-M5 version

* Generate samples for micronaut client

* Add hidden files of generated samples for micronaut client

* Add and configure micronaut tests as maven profile

* Add option to choose between junit and spock for micronaut client generator

* Add tests for micronaut 'build' and 'test' options; regenerate micronaut samples
2021-08-15 22:36:45 +08:00
Arthur Mogliev
2210c9f016
[PHP] New client generator php-dt (#10041)
* - new PHP client generator php-dt

* - samples regen after rebase

* - README update

* - fix missing options for php-dt-modern config

* - use another workaround to prevent special treatment of form media types in DefaultGenerator - GlobalSettings usage mangled behaviour of other generators
- fix of missing spaces in generated docs

* - samples update after rebase
2021-08-15 22:15:44 +08:00
James Gilliland
09a4da0970
Make php's array a primitive (#10093)
Fixes a bug where code generation would sometimes treat arrays as
objects and break serialization and code documentation.
2021-08-07 21:02:40 +08:00
William Cheng
31eb65ab67
[C#][netcore] minor bug fixes (#10074)
* fix property name, fix enum comment

* update doc
2021-08-03 16:43:39 +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
SimeonGerginov
3663831b4d
[REQ][PowerShell] Improve generated PowerShell examples (#9836)
* Implement new PowerShell example structure

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Modify documentation template to work with the new PowerShell example format

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Update PowerShell Generator documentation with the new properties

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Update PowerShell samples with the new PowerShell example format

Signed-off-by: Simeon Gerginov <sgerginov@vmware.com>

* Fix issues with array of models as parameters

Signed-off-by: Simeon Gerginov <simeongerginov1@gmail.com>

* Change string value generation to include the prefix 'My'

Signed-off-by: Simeon Gerginov <simeongerginov1@gmail.com>

* Remove multiple new lines and trim leading and trailing spaces in PowerShell example

Signed-off-by: Simeon Gerginov <simeongerginov1@gmail.com>
2021-07-03 22:27:06 +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
Ghufran Zahidi
90233d6653
conditional serialization add only those property which user wants to… (#9807)
* conditional serialization add only those property which user wants to configure.

* fixed the samples

* fixed the sample String to string issue.

* fixed the sample String to string issue.

* updated the sample

* Added unit test for conditional serialization

* update samples

* remove trailing spaces, update samples

* remove files

* add back files

* build the project in the ci

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-06-29 20:28:47 +08:00
bflamand
48e05ce162
[Typescript Fetch] New optional mode with redux saga & immutablejs (saga & records) (#8578)
* first commit: add cli option for saga and records. Added dummy sagas.mustache test file.

* More progress with default values. First prototype for isEntity and isUniqueId.

* record generation complete

* record generation complete

* progress with saga generation

* progress with saga generation

* first fully working saga generation

* merge with latest master

* removed unneeded "items" properties.

* moved global CodegenModel modifications into subclass ExtendedCodegenModel used exclusively by TypescriptFetchClient. Adding missing samples files.

* moved global CodegenOperation modifications into subclass ExtendedCodegenOperation used exclusively by TypescriptFetchClient.

* moved global CodegenProperty modifications into subclass ExtendedCodegenProperty used exclusively by TypescriptFetchClient.

* moved global CodegenParameter modifications into subclass ExtendedCodegenParameter used exclusively by TypescriptFetchClient.

* added the missing "allSagas" export.

* renamed & reworked "meta data response" flags to a more useful general concept of "operation return passthrough"

* added vendor flag keepAsJSObject as escape hatch to support circular dependencies in models and other special cases. Also fixed issues with default values for some records properties.

* added autodetection for passthrough to simplify standardised specs.

* fix small issue with passthrough void

* fix small issues with passthrough void and missing passthrough imports in some cases. Fix issues with enum default values.

* fix small issues with passthrough void and missing passthrough imports in some cases. Fix issues with enum default values.

* Added "reservedRecordField" feature to support remapping fields names that cannot be used in Records. Added missing export to record: toApi().

* added uniqueId inference. Fix small generation when uniqueId property is an array.

* removed feature "reservedRecordField" and replaced it with existing built-in "reserved words" feature. Fix minor issues with typings in generated files.

* Changed api recType names to make them less likely to cause name conflicts. Added generated ApiEntities (record, reducer & selector) files.

* Moved location of ApiEntities related files and fix issues with exports.

* - merge latest master
- renamed fake test apis to better fit the "pet theme"
- added mode for "SourceOnlyLibrary" (same as used in codegen typescript jquery)

* - missing ganarate sampless

* - Modified way to export apiEntitiesSelectpr to reduce typescript analysis time for consuming project. Removed tab characters in mustache files. Reformat code for TypeScriptFetchClientCodegen to try to remove false positive for tabs vs spaces.

* - added markErrorsAsHandled property to api sagas. Increased typescript version to address some typing errors on library build.

* - fix bug in saga interfaces. Upgraded to typescript "strict" mode to ensure proper typechecking info is generated.

* - added optional id for apiEntity selectors. Added toInlined() support to convert an entity to an inlined model recursively.

* - minor tweak for apiEntitySelector to accept null id

* - minor tweak for apiEntitySelector

* - runned ensure up to date.

* Revert "- runned ensure up to date."

This reverts commit ea9b4aed

* - runned ensure up to date.

* - runned ensure up to date.

Co-authored-by: Bruno Flamand <bflamand@stingray.com>
2021-06-24 00:07:17 +08:00
Sascha Peilicke
463d905664
Kotlin-Server: Optional metrics and upgrade to Ktor 1.5.4 (#9358)
Use Gradle 6.9 and Kotlin 1.4.32. Generate Paths for other HTTP verbs
(#828) and fix imports (#5640). Use 'object' when no parameters are
used. Introduce 'featureMetrics' to control metrics plugin usage. Remove
HOCON configuration parsing. This is provided by
`Application.environment.config already` and removes a dependency.

Resolves #9087, resolves #828, resolves #5640
Relates-To #5346
2021-06-20 22:03:44 +08:00
Ween Jiann
77e1ca56cf
[go-server] Add go-chi generator to go-server via a router property (#9748)
* Add go-chi generator to go-server

* Add go-chi configs

* Add go-chi generated output

* Updated docs

* Add some javadocs

* Fix import issue

* Regen files
2021-06-16 16:53:20 +08:00
devhl-labs
46f8a6733a
[csharp] Move nullable reference types switch to abstract (#9661)
* moved switch to abstract

* build samples

* added nullable option to csproj

* removed unused method

* added switch back to aspnetcore

* build samples
2021-06-09 16:09:39 +08:00
Mike Marchetti
7125ef43f5
Typescript: fix: add paramPropertyNaming (#9546)
Model naming conforms to the property: modelPropertyNaming, however the
parameter naming scheme is currently hardcoded to camelcase. Since the
parameter names are closely tied to the model properties names, is maybe
desirable to use a similar naming approach.

The toParamName cannot directly use the paramPropertyNaming since that
will cause issues with current generated code, since the
modelPropertyNaming currently defaults to "original"

A new property has been created to override this behavior, named
"paramPropertyNaming", and its default is set to "camelcase".
2021-06-07 22:17:25 +02:00
Ayman Bagabas
f923a0ef15
Swift5 Vapor 4 client library (#9625)
* [swift5] Add Vapor client library

* Try to improve overall spacing (#17)

* [swift5] try to remove changes in model and api

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* [swift5] update sample projects

* Update samples

* [swift5] vapor: return clientResponse when no default case

* Update samples

Co-authored-by: Bruno Coelho <4brunu@users.noreply.github.com>
2021-06-06 22:08:14 +08:00
Troy P
7bb7c72cc5
Adding usePythonSrcRootInImports logic to AbstractPythonConnexionServerCodegen. (#9558) (#9559) 2021-06-02 09:03:45 -07:00
Michael Janssen
b9e75951e7
Add nullable annotation support to AspNetCoreServer (#9620)
* Add nullable annotation support to AspNetCoreServer

* Adjust naming for compatability with PR #9235 by @dehl-labs
2021-06-02 11:54:16 +08:00
Ayman Bagabas
c4df343052
[Swift5] Add useClasses cli option (#9608)
* [swift5] Add useClasses cliOption

* Update swift docs
2021-05-31 10:37:14 +08:00
Nikita Vakula
0da4099868
New python-fastapi generator (#9611)
* [python-fastapi] Added new generator

See https://fastapi.tiangolo.com/ for more details about FastAPI

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>

* [python-fastapi] Added samples

Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
2021-05-30 17:43:31 +08:00
William Cheng
763f65f293
[Wsdl] minor improvements, bug fixes (#9613)
* minor improvements to wsdl-schema gen

* better code format

* update readme
2021-05-28 21:38:36 +08:00
William Cheng
28c3e1d544 update samples, docs 2021-05-28 10:26:48 +08:00
adessoDpd
12c34d4658
New generator: WSDL (#9545)
* init port

* add outputDir

* fill out current .md

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-05-28 10:22:28 +08:00
William Cheng
32d5900611 update samples, docs 2021-05-27 10:40:32 +08:00
desmese
4f1d8f4699
- added localVar prefix to the contentType variable defined in the api.mustache template in the java resttemplate library (#9568)
- rerun generate-samples.sh and export_docs_generators.sh
2021-05-27 10:24:38 +08:00
Bruno Coelho
b5843f41a6
[swift5] update docs (#9587) 2021-05-27 10:05:48 +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
Ayman Bagabas
ae0350280f
[swift5] Map file and binary to Data (#9419)
* [swift5] Map file and binary to Data

Fixes: https://github.com/OpenAPITools/openapi-generator/issues/9308

* Update docs
2021-05-26 17:02:28 +08:00
William Cheng
ae430a8c14
[cpp][tiny] rename generator, update samples (#9560)
* rename generator, update samples

* add doc

* update readme
2021-05-25 23:55:16 +08:00
Anders Aaen Springborg
4e48dae8e4
New generator | Arduino cpp (#9489)
* initil tiny client generator

* Helper string

* WIP: added helper file with json helper functions

* WIP: model implementation.. Working on JSON

* Added codegen files for model and helper

* WIP: toJson()

* Added mapping configurations

* Upadet string compare

* Removed redundant namespaces

* Added files for example

* fixed syntax errors

* fixed syntax errors

* header generation

* unittest example for pet class

* Refactored mustache & fixed logical errors

* WIP: unit test mustache format

* Removed legacy file

* mustache service

* Declare service in Java file

* Removed legacy file

* removed legacy code

* Documentation

* Added folder structure + new supporting files

* Added file to run all unittests

* Refactored unit tests

* typemappings and new paths

* First service impl

* Added esp32 and esp8266 env

* Added default values

* Added cli option to specify controller

* added type decl method

* Added stringify methods

* service get requests

* Fix helper header

* post merge fix

* fix long test

* Tiny namespace

* remove shared pointer

* include petapi

* stringify

* return problems

* Canged logic for response-body handling

* Implemented last logic for reponse handeling

* Implemented constructor logic

* first tiny sample

* update basepath to petstore v3

* standard main example

* root certificate example

* root folder

* TODO cleanup

* exclude features

* supports delete again!👷

* remove todo 

* new main example ❣️

* new main example ❣️

* Make our feature set realistic

* fix indentation

* HTTP / HTTPS Connection

* Root certificate sample

* https vs http 👨🏻‍🔬

* fix lint in template

* default value for controller in config

* new readme 📜

* remove old comments

* removed unused testfile

* no default root certificate

* new main

* remove test

* Update platformio.ini.mustache

🤷‍♂️

* Update platformio.ini.mustache

remove native

* added support info

* Add namespace to Pet 🐅

* bourne compatibility fix

* spelling error in python file

* bourne python script 🐍

* Version bump

* Add bourne script to readme

* update main sample, from template

* pre_compiling_bourne.py.mustache to samples folder 📃

* set header Content'type to json

* map todo🗺️

* remove unused debug flag⚒️

* added support for ESP8266 ༼ つ ◕_◕ ༽つ

* added new sample for ESP32 📀

* 🎯

* removed use of namespace std 

* removed use of "__" in variables

* removed unused code in destructor

* fixed type comparison

* move default ctor to header

* added zero initialized primitive variables

* moved variable to TypeMappings

* updated ifndefines

* Extra comment for build error in standard example 🦸🏽‍

* afer cpp-ish cast from std::string to uint8* cast🏰

* excluded maps type

* Documentation og generator

Co-authored-by: kaareHH <kaare.hattel@gmail.com>
Co-authored-by: mkakbas <45030188+mkakbas@users.noreply.github.com>
Co-authored-by: mkakbas <martinkandersen1@gmail.com>
2021-05-24 11:11:44 +08:00
Arthur Mogliev
ab6d66147b
[php-mezzio-ph] PHP 8 support (#9445)
* Huge update for php-mezzio-ph generator:
- proper container support for data types
- support for query parameter references and query parameter schema references
- dependency update (PHP 7.3+, PathHandler 0.7+, DataTransfer 0.5+)

* Sample regeneration after rebasing for php-mezzio-ph

* - added custom CLI option for php-mezzio-ph to generate code using modern PHP syntax
- removed obsolete php-mezzio-ph samples in samples/openapi3/server/petstore/php-mezzio-ph

* - fixes for JavaDoc declarations that seems to break CI

* - fix for outdated sample file
2021-05-21 14:40:38 +08:00
Makoto Aoyama
0a34839567
Add hashableModels to additional properties (#9495)
* Add hashableStruct

* Revert "Remove x-swift-hashable"

This reverts commit 18053af0016fdba13fd1e5df00ad86abee071283.

* Add Hashable for x-swift-hashable

* Add config yaml to test x-swift-hashable

* Run ./bin/generate-samples.sh ./bin/configs/swift5*

* Run ./bin/utils/export_docs_generators.sh

* Run ./bin/generate-samples.sh ./bin/configs/swift5*

* Verify setHashableStruct

* Rename hashableStruct => hashableModels

- Replace hashableStruct => hashableModels
- Replace HashableStruct => HashableModels
- Replace HASHABLE_STRUCT => HASHABLE_MODELS
- Update docs

* Refactor modelObject.mustache

* Control equals and hash functions
2021-05-20 23:04:19 +08:00
William Cheng
9e4afb0fc3
[C++] Rename Qt5 to Qt (#9490)
* rename qt5 to qt

* rename, update

* rename qt5 to qt in the templates

* update doc
2021-05-18 23:09:59 +08:00
William Cheng
c4f7091da5
partially revert 9404: avoid empty string enum value (#9501) 2021-05-17 23:47:07 +08:00
Bruno Coelho
e6a10ae350
[swift5][client] add option to generate or not the model additional properties (#9375)
* [swift5][client] add option to generate or not the models additional properties

* [swift5][client] update sample projects

* [swift5][client] format code

* [swift5][client] format code

* [swift5][client] format code

* [swift5][client] update docs
2021-05-15 15:46:32 +08:00
Sheldon Young
f9cd80deed
[scala-sttp] Bump minor versions of libraries, SBT and Scala (#9356) 2021-05-12 21:29:51 +08:00
Bruno Coelho
3173e0b1d3
[kotlin][client] improve docs (#9393) 2021-05-10 20:42:13 +08:00
William Cheng
be214dc349 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-05-07 10:15:12 +08:00
matt beary
32b2ea3291
Fixes #9398: fix aspnet enum documentation (#9404) 2021-05-06 11:23:32 +08:00
Rustam
ccbb78e1b2
Keep old Ktor server generator for backward compatibility (#9365) 2021-04-29 08:26:57 +08:00
Rustam
53398a0850
Ktor server upgrade (#9088)
* Update to new ktor version #9087

* Update doc #9087

* Cleanup #9087
2021-04-28 21:57:15 +08:00
William Cheng
37eaf70755 Merge remote-tracking branch 'origin/master' into 5.2.x 2021-04-28 17:48:21 +08:00
Ayman Bagabas
0f5e7d1e3c
Swift5 models improvements (#9205)
* [swift5] Add useClasses to use `final class` instead of `struct`

* [swift5] Always include CodingKeys enum

* [swift5] Implement model equals and hash functions

* [swift5] Encode `null` values

* [swift5] Test `useClasses` in urlsessionLibrary

* [swift5] Add a required nullable prop test case to 2_0/swift/petstore*.yaml

* [swift5] Update samples and docs
2021-04-24 10:04:30 +08:00
William Cheng
ab688d4c3a
Update documentation (#9322)
* update doc

* update doc
2021-04-22 20:54:01 +08:00
Ayman Bagabas
33107c14de
[Swift5] escape reserved words (#9204)
* [swift5] `List` is not a Swift data type

* [swift5] Escape reserved words using backticks

https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#ID412

* [swift5] Update tests

* [swift5] Update samples and docs
2021-04-22 19:13:39 +08:00
Ayman Bagabas
3894aa4759
[swift5] Add useSPMFileStructure (#9074)
* [swift5] Add useSPMFileStructure

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>

* [swift5] Add swiftPackagePath

Prioritize swiftPackagePath over useSPMFileStructure

* [swift5] Add cli options and update docs

* [swift5] Fix tests

* [swift5] Update XcodeGen source path

* [swift5] Update samples and docs

Add useSPMFileStructure to URLSession library
2021-04-22 00:43:33 +08:00
Farshad Nematdoust
733a180a62
Add Go echo server codegen (#9224)
* Update codegen config

* Add templates for Go Echo openapi-codegen

* Add the yaml config file!

* Add GoEchoServerCodegen.java.
This is the first iteration, it works but probably needs a lot of improvements.

* Update codegen, adds some comments.

* Update GoEchoServerCodegen.java

* Update GoEchoServerCodegen.java

* Update GoEchoServerCodegen.java and related yaml file

* Add the result of generate-samples.sh for CI purposes.

* Add the result of bin/utils/ensure-up-to-date for CI purposes.

* Update go-echo-server-petstore-new.yaml
Fix the outputdir

* Update in regard to result of ./bin/generate-samples.sh

* Update in regard to result of ./bin/generate-samples.sh

* Remove wrongly generated files

* Add correct generated files.

* Add changes regarding /bin/utils/ensure-up-to-date

* Update templates to include comments.

* Update/add result of ./bin/generate-samples.sh and ./bin/utils/export_docs_generators.sh
2021-04-21 16:22:10 +08:00