11973 Commits

Author SHA1 Message Date
mvistein
c12456de8e
[Java-okhttp-gson] Do not set content-type if content type is null #2 (#11315)
* Fixing empty Content-Type in HTTP requests

* Updating samples
2022-01-16 10:29:47 +08:00
jiangyuan
0427681bc4
fix java apache-httpclient set basePath (#11277) 2022-01-16 10:23:15 +08:00
Paul-Etienne François
249968e397
[Java][Native] Fix the Content-Type and Accept headers that were forced to application/json (#11303)
* [Java][Native] Fix the Content-Type and Accept headers that were forced to application/json

* Update the generated samples after fixing issue no. 6779
2022-01-16 00:51:40 +08:00
Anakael
1b6d0f8746
Add condition for header (#11325) 2022-01-16 00:18:12 +08:00
Knut Johannes Dahle
692a4db964
Added fix for wrongly encoded backticks when generating kotlin client with reserved words as part of the parameters. Wrote a test verifying that the method signatures is without html encoding for backticks (#11310) 2022-01-15 23:59:42 +08:00
Ethan Keller
6430aaf3b1
recursively search for types during import type collection in deeply … (#11221)
* recursively search for types during import type collection in deeply nested schemas #11220

* composed schema recursive type import handling

* change Importable to ComplexType to modularize related type-wrangling.

* Problems...

* Revert "Problems..."

This reverts commit 6154f202a0f4db7a706fe3d61b45573581d164d4.

* Reverted attempts to reuse recursive type-finding code.

* add javadoc comments

* fix javadoc warning.

* fix NPE

* PR feedback incorporation

* Include additionalProperties recursion.

* More feedback

* More feedback

* Add comments from feedback
2022-01-14 12:39:22 -08:00
Justin Black
57987424a4
Revert "Has generators set default template engine (#11245)" (#11316)
This reverts commit dd3bba8c9442f2ee40d6ea8f0872ab0be43714b9.
Because it broke peoples builds per this issue https://github.com/OpenAPITools/openapi-generator/issues/11276
2022-01-14 10:52:36 -08:00
Amelia Raia
d8cb6bd894
Allow the user to pass in any headers per request. #11139 (#11140)
* [Python] Allow the user to pass in any headers per request

* Update docs

* Update docs

Update Docs _headers

* Add test

Co-authored-by: Rizwan Saeed <rizwan.saeed@finbourne.com>
2022-01-13 15:25:40 -08:00
William Cheng
759883f804
minor enhancements to java camel generator (#11296) 2022-01-14 01:08:22 +08:00
Bodo Graumann
7129cdebc5
[typescript] Make module usable with esbuild (#11298)
* Use default import from url-parse

* Update samples

* Fix typo in readme
2022-01-13 17:06:04 +01:00
Giacomo
2e6e82161f
Apache Camel Server Generator (#11162)
* Created Apache Camel language

* Added unit test

* Fix template dir

* Fix description api

* Camel Dataformat Properties

* Apache Camel Doc

* Apache Camel Doc

* Apache Camel Doc

* Apache Camel maven plugin example

* Fix LOGGER

* Samples

* Camel 3.14

* Samples

* samples

* up to date

* Rename camel to java-camel

* up to date

* Fix SerializedName in modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
2022-01-13 01:28:02 +08:00
William Cheng
69b64ebb0e
[kotlin][client] add tests for comma separated list in array path params (#11293)
* add tests for kotlin-array-simple-string

* add new files

* remove build fies

* clean up
2022-01-13 01:26:07 +08:00
Johan Sjöblom
3ed9a8e53c
Make Kotlin client generate comma separated list for array path params (#11228) 2022-01-13 00:59:00 +08:00
방진영
69db8176b6
keyword conflict with zebos list_creat(), list_free() (#11190)
* keyword conflict with zebos list_creat(), list_free()

* keyword conflict in zebos list_create list_free
2022-01-13 00:42:58 +08:00
Ashutosh Gangwar
1bfed460c5
Fix missing ApiKeyAuth import in 'jvm-retrofit2' Kotlin client template (#11286)
* fix incorrect ApiKeyAuth import in jvm-retrofit2 kotlin-client template

links to
- https://github.com/OpenAPITools/openapi-generator/issues/10008
- https://github.com/OpenAPITools/openapi-generator/pull/10708

* update kotlin-retrofit2 samples
2022-01-12 19:22:24 +08:00
Justin Black
95a1154c20
python-experimental adds DecimalSchema (#11282)
* Fixes test

* Adds decimal examples to the pythonExp generator

* Adds isDecimal to CodegenModel, updates python-exp samples

* Fixes decimal types in ObjectModelWIthDecimalProperties and DecimalPayload

* Updates tests

* Decimal feature added to python-exp docs

* Samples and docs regenerated
2022-01-11 21:51:50 -08:00
Justin Black
ce04e9b6a2
python-experimental, redundant docstrings removed (#11281)
* Removes docstrings drom models because type hints already includes this info

* Samples updated
2022-01-11 09:31:25 -08:00
jiangyuan
45b66d660a
[python] modify python import classVarName to classFileName (#11180)
* fix python import classVarName to classFileName

* add samples change
2022-01-10 23:21:29 -08:00
Justin Black
1f7eebd52d
Fixes openapi-generator.tech content, python-exp documentation helpTxt updated (#11273)
* Fixes python-exp line breaks

* Docs updated
2022-01-10 20:11:57 -08:00
Anakael
f06e7c52f4
Add only one auth header (#11272) 2022-01-11 12:09:33 +08:00
joaocmendes
b05faefb93
[BUG][csharp-netcore] Fix Multi Files for the same FormField (#11132) (#11259)
* [BUG][csharp-netcore] Fix Multi Files for the some FormField  (#11132)

Make FileParamerts a Multimap to enable sending more than one file with the same key.

* update documentation for csharp-netcore
2022-01-11 11:02:39 +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
dd3bba8c94
Has generators set default template engine (#11245)
* Adds default template engine to generators

* Fixes sample batch generation
2022-01-10 08:59:20 -08:00
Sorin Florea
a4325ec520
ISSUE-11242: Fix Java native path param encoding (#11257) 2022-01-10 21:23:28 +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
carmenquan
478219744e
Making PyPi markdown friendly requires additional property (#11093)
* updating python markdown property

* adding to samples
2022-01-09 08:22:11 -08:00
Matthew
e7ca67071e
[python] Fix 10773 - Use base_name for file uploads in form data (#11182)
* Use base_name for file uploads in form data

* Added missed sample changes
2022-01-09 08:19:57 -08:00
Akira MATSUDA
febf49662a
Make moduleObject.mustache confirms to JSONEncodable. (#11202)
* Make moduleObject.mustache confirms to JSONEncodable.

* Regenerate samples

* Don't confirm JSONEncodable when using Vapor.

* Use CodableHelper.jsonEncoder

* Encode `Data` using `encodeToJSON()`

* Update sample

* Don't extend JSONEncodable when using Vapor.

* Add JSONEncodable in moduleEnum, moduleInlineEnumDeclaration, and modelOneOf

* Update sample

* Remove line break.

* Update sample

* Revert "Update sample"

This reverts commit 6ec206b506a5402a225184bd8e80f5e654f426f8.

* Don't confirm JSONEncodable when enum confirms RawRepresentable.

* Update sample

* Add space before {

* Update sample

* Don't confirm JSONEncodable when enum confirms RawRepresentable.
2022-01-09 23:47:03 +08:00
Andreas Allacher
ef882a4e6c
Issue 11152: Allow guzzlehttp/psr7 ^1.7 or ^2.0 (#11240) 2022-01-07 09:07:09 +08:00
jiangyuan
e1902257b3
[Python] add '_spec_property_naming' param (#11226)
* add '_spec_property_naming' param

* add '_spec_property_naming' comment

Co-authored-by: jiangyuan04 <jiangyuan04@baidu.com>
2022-01-05 14:26:10 -08:00
Justin Black
3243279b4d
Adds python-experimental with dynamic base classes (#8325) 2022-01-05 12:30:49 -08:00
Aliaksei Zhuk
9c3d4ef2a6
Parse integer array query parameters. Fix typos (#11105) 2022-01-04 17:55:18 +08:00
S2021Git
361b593da2
Not creating "Accept:null" header for Java-Jersey2 generator (#11084)
* updated ApiClient.mustache for jersey2

* updated samples

* corrected indentation

* updated samples
2022-01-04 16:41:24 +08:00
Ilario
74f39b442e
Bugfix of #11176 and related #10706 CPP-QT-QHTTPENGINE Server (#11177)
* Fix extra m that prevents qt cpp server to build (#11176)

* Fix regular expression to capture IDs on path (#11176)

* Fix build issue missing QHttpEngine namespace (#10706)
2022-01-04 15:14:11 +08:00
Ignacio Campos Rivera
8c090c978d
feat(python-asyncio): add support for proxy config using system env vars (#11171)
Co-authored-by: Ignacio Campos <ignacio.campos@global.ntt>
2022-01-04 15:08:03 +08:00
Mostafa Aghajani
a3b90183aa
Fix musache template to use "{{package}}.{{dataType}}" on all non primitive types (#11201) 2022-01-04 14:47:42 +08:00
Yohei Kitamura
5a616757e7
Fix examples for request body with array to not raise java.lang.NullPointerException (#11170) 2022-01-04 14:36:28 +08:00
Yuriy Belenko
0a09f1faa3
[php][bug] Fix DateTime microseconds bug in ObjectSerializer (#11213)
* fixing precision for php

* remove a bracket

* handling whitespace

* format comment

* Use regexp to trim needless microseconds

That way we can save timezone suffix.

Co-authored-by: Carmen Quan <cquan@launchdarkly.com>
2022-01-04 13:41:22 +08:00
William Cheng
9f899c5e6d
minor bug fixes in ts fetch generator (#11215) 2022-01-04 13:39:57 +08:00
William Cheng
d17a472b89 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-03 18:03:00 +08:00
William Cheng
15b228c3ca
fix import mapping for JsonValue (#11216) 2022-01-03 17:05:38 +08:00
sullis
6397421399
[scala-gatling] add ScalaGatlingCodegenTest (#11212) 2022-01-03 11:56:58 +08:00
William Cheng
ae880c94a9
various minor bug fixes based on sonar report (#11214) 2022-01-03 11:56:35 +08:00
Thomas Bredzinski
508da12ca7
Add support for asynchronous API for JavaJaxRsSpec (#10919)
* Add support for asynchronous API for JavaJaxRsSpec

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

* Ran the requested command for a PR

Run the following to build the project and update samples:
./mvnw clean package
./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh

* Set java 8 mode when using supportAsync=true

`CompletionStage` are only introduced since 1.8, enabling async should for use java8

Co-authored-by: Thomas Bredzinski <thomas.bredzinski@gemalto.com>
2022-01-03 09:55:01 +08:00
agilob
6c3cdee6fb
Dart - update generator to support null safety (#10637)
* fix: Make dart2 generated code compilable

* Update dart2 client samples

* Re-add deleted test files

* Lower dart version to 2.12

* Make username and pass not null in http basic auth

* Delete json_serializable

* Make growable false by default

* Make value not nullable

* Remove redundant null check

* Revert linter fix

* Provide required username and pass

* Revert initial abstractDartCodeGen changes

* Revert removing dart pom module

* Revert removing dart pom module

* Lower minimum dart version to 2.12

* Disable dart2 tests generation

* Disable petstore_client_lib

* Disable samples/openapi3/client/petstore/dart2/petstore

* Re-add dart2 tests

* Add new tests

* Delete empty directory

* api_client.mustacheUpdate 

added optional HttpBearerAuth so you can add the token directly on the ApiClient

* Update api_client.dart

auto generated files for build

* Update api_client.dart

Autogenerated files for buiild

* Make mapDateTime nullable and add ! after json mapping

* Fix warning on Future<?>

* Fix warning on Future<?>

* Dont insert unused param to constructor

* Modified Dart2 Mustache template.

* Regenerated Petstore source code.

* Remove extra code to sync with agilob's pr.

* Regenerated Petstore source code.

* Fix a couple of reported bugs.

* Regenerated Petstore source code.

* Make properties non-nullable.

* Regenerated Petstore source code.

* Do not trim user input before submitting.

* Regenerate Petstore source code.

* Regenerate Petstore source code.

Co-authored-by: Kate Döen <kate@stack11.io>
Co-authored-by: Artur Powroznik <arturp@backbase.com>
Co-authored-by: devjakobsen <94956607+devjakobsen@users.noreply.github.com>
Co-authored-by: Noor Dawod <noor@fine47.com>
2022-01-02 21:13:02 +08:00
cachescrubber
e71ee1bf43
[Java Spring OAS3] Fix numerous OAS3 related Bugs (#11181)
* Oas3: Remove swagger2 ApiModel and ApiModelProperty from imports when oas3 is true.

* Oas3: Use either swagger v2 or v3; add test config

* Oas3: allowableValues and defaultValues belong to the Schema annotation

* Oas3: use swagger-core.version property in all pom.xml

* gh-11165 remove io.swagger.v3.oas.annotations.parameters.RequestBody

* gh-11168 add import for io.swagger.v3.oas.annotations.Hidden

* Fix formParams.mustache, add dedicated test scripts for the spring generator using oas3.

* Run ./bin/generate-samples.sh

* Run ./bin/generate-samples.sh - new samples

* fix indentation

* Revert to threetenbp 2.9.10 because customInstantDeserializer.mustache is not compatible with threetenbp > 2.9.10.

* apiController.mustache: pull in osa3 imports.

* apiDelegate.mustache: remove io.swagger.annotations.* import

* Remove Hidden (import and usage). Wrap atApiIgnore with useSpringfox.

* fully qualify org.springframework.data.domain.Pageable because endorExtensions.x-spring-paginated is not set during import processing.

* align spring-cloud and spring-boot pom.mustache regarding springfox and oas versions.

* introduce dateTimeParam.mustache

* Apply DateTimeFormat consistently across different parameter types

* revert to springfox 2.9.2

* add newline after parameter

* fix atSchema annotation (use empty description)

* add more spring-*-oas3 test configs

* Update bin/config/spring* test samples

* Fix implicitHeader.mustache - add import, generate use paramDoc.

* rename spring-boot-implicitHeaders-oal3.yaml to spring-boot-implicitHeaders-oas3.yaml

* Add spring oas3 configs to samples.circleci profiles module list

* Use groupId 'org.openapitools.openapi3' for oas3 configs

* Run all spring test configs.

* In OAS3, allowableValues is a String[] array.

* formParams.mustache: Align spacing and newlines with other param templates

* Support @Parameter(hidden = true) instead of ApiIgnore, Formatting: One parameter per line.

* Format method level annotations in api.mustache

* Introduce samples.circleci.spring profile

* Generate all spring samples
2022-01-02 21:05:46 +08:00
bflamand
5152f8dee0
Java playframework: add support for oauth2 accesstoken validation (#10901)
* 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.

* - added more enhancements: New "toInlined" functionality. Support for more complex double array types. apiBaseConfiguration is not sent completely for Api.init().

* - merge master

* - fix generated api bug in some cases for typescript fetch when no request params are present.

* - commented broken tests

* - fix generate samples analysis.

* - work in progress for playframework swagger upgrade

* - first working output for playframework with oauth support for access code flow.

* update surefire to newer version

* added new sample project "...playframework-with-security.yaml" and improved tab in generated output for controllerImp files.

* split SecurityAPIUtil into more granular and useful functions.

* minor fix to have tab instead of spaces in securityapiutils mustache file

* added missing generated samples.

* added missing securityAPIUtils injection in generated "Controller" classes when "useInterfaces = false"

* added missing securityAPIUtils import

* added missing securityAPIUtils import for no-interface samples files.

* minor tweak: changed order of import for securityApiUtils

* minor tweak: changed order of import for securityApiUtils

* fix: securityApiUtils was incorrectly declared with "throws Exception"

* minor code tweak.

* fix potential runtime throw in SecurityApiUtils if playframework configuration variables are not found. fix minor issue with space vs tab in mustache files. Fix compilation issues in some cases when using async mode.

* run ensure-up-to-date and generate-samples

* Revert "run ensure-up-to-date and generate-samples"

This reverts commit da4d3ac7552376268fdb800fc7d42722367e9e47.

Co-authored-by: Bruno Flamand <bflamand@stingray.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-01-02 20:45:33 +08:00
KristopherTadlock
a20cee3024
Add isSkipOperationExample check before generating op.requestBodyExamples in the DefaultCodeGe. This avoids the running out of heap space error one gets when generating a large spec file (#11144)
Co-authored-by: Kristopher Tadlock <tadlockk@infintech.com>
2022-01-02 18:14:46 +08:00
Marc Miltenberger
783f843690
[Java-OKHTTP-GSON] Do not set content-type if content type is null (#11199)
Co-authored-by: Marc Miltenberger <Marc.Miltenberger@sit.fraunhofer.de>
2022-01-02 17:33:41 +08:00