7409 Commits

Author SHA1 Message Date
Bruno Coelho
dd9a19ab8f
[Swift 5] fix Multipart FormData encoding and add support for Form URLEncoded enconding (#8275)
* [swift5] fix issue with form data with null file

* [swift5] fix issue with form data with null file on alamofire implementation

* [swift5] update sample projects

* [swift5] fix issue with form data with null file on alamofire implementation

* [swift5] add support for form url enconded in URLSession

* [swift5] add support for form url enconded in Alamofire

* [swift] improve code formatting

* [swift] improve code formatting

* [swift] dont defaut to application/json
2021-01-05 09:27:14 +08:00
Bruno Coelho
d2aa40a935
[Swift 5] deprecate retry hook since its no longer needed (#8303)
* [Swift 5] deprecated retry hook since its no longer needed

* [Swift 5] deprecated retry hook since its no longer needed

* [swift] fix generator code formatting
2021-01-04 19:34:28 +08:00
Arnaud Jeansen
0c5cec8f75
7141: filter out problem+json mime type from JSON mime types fast tra… (#7976)
* 7141: filter out problem+json mime type from JSON mime types fast tracked into the Accept header (resttemplate)

* 7141: ran ensure-up-to-date

* 7141: minimize changes with master (keep using isJsonMime for MediaType)
2021-01-04 11:02:39 +08:00
Nicholas Muesch
00d56375b0
Use Map interface for configureApiKeys (#7982) 2021-01-04 10:54:01 +08:00
Bruno Coelho
163c70e7d8
[Swift 5] create sample for URLSsession and Alamofire bearer authentication (#8302)
* [swift] create a sample of bearer token authentication with URLSession

* [swift] create a sample of bearer token authentication with URLSession

* [swift] create a sample of bearer token authentication with URLSession

* [swift] create a sample of bearer token authentication with URLSession

* [swift] create a sample of bearer token authentication with Alamofire

* [swift] create a sample of bearer token authentication with Alamofire
2021-01-04 10:03:26 +08:00
Bruno Coelho
72d6cff188
iOS - fix XcodeGen deploy target to match cocoapods (#8279) 2021-01-04 09:55:59 +08:00
Bruno Coelho
14efb8c70f
[swift 5] update dependencies (#8277) 2021-01-04 09:55:23 +08:00
Josh Goldberg
566e7ef583
Fix two spaces after get headers() in typescript-fetch (#8294) 2020-12-30 10:32:40 +01:00
Bruno Coelho
775b64f6c7
[swift5] add URLResponse to ErrorResponse (#8267)
* [swift5] add URLResponse to ErrorResponse

* [swift] improve unit tests

* [swift] improve unit tests
2020-12-29 23:31:12 +08:00
William Cheng
25b0cbe2f1
Prepare 5.0.1 snapshot (#8249)
* update version to 5.0.1-SNAPSHOT

* update samples

* update meta codegen
2020-12-21 17:14:18 +08:00
William Cheng
4261252491 prepare 6.0.0 snapshot release 2020-12-21 16:39:40 +08:00
William Cheng
345b68a107 prepare 5.1.0 snapshot release 2020-12-21 16:35:12 +08:00
William Cheng
d7d5e53f2b
Prepare v5.0.0 release (#8247)
* update to 5.0.0

* update samples
2020-12-21 13:04:11 +08:00
William Cheng
79a18b0440
[Qt5] rename the extension (#8236)
* rename extension, move config

* purge folder, regenerate samples
2020-12-19 15:16:46 +08:00
basyskom-dege
febd65d3b8
Qt5 parameterized server (#8183)
* first Commit parameterzied Server support

* fixed serverconfig classes

* Defautl constructor f. Config, fixed regex replace

* Polosihed Templates, Added MultiServer support

* Update Readme. Fixed MultiServer. Fixed def. Value

* Passing global Server to mustache. Small fixes

* Updated  samples, fixed mustache for multi server

* added prefixes, removed unused imports

* added newly generated samples

* missing vendorExtension in mustache. Update smaple

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-19 11:34:12 +08:00
William Cheng
0be3fe6104
Set skipFormModel to true by default (#8125)
* set skipFormModel to true by default

* update tests

* regenerate ruby faraday client

* remove inline object spec files

* more clean up on inline object files

* update samples
2020-12-18 23:57:19 +08:00
Ghufran Zahidi
52c63bb325
Fixed the query string for HttpSigning core vs dotnet47 (#8189)
* Fixed the query string for HttpSigning core vs dotnet47

* updated the sample

* replace the tab with space

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-18 12:35:05 +08:00
William Cheng
a407090bef update samples 2020-12-18 12:28:41 +08:00
agilob
13042b76ea
[java] Add setBearerToken method in okhttp-gson (#8200)
* Add setBearerToken method in okhttp-gson

* Update generated files
2020-12-18 12:08:30 +08:00
Aanisha Mishra
f766735d5c
[Python][Client] Python model directory init missing (#8215)
* include model and api dir init mustaches

* update examples

* remove unwanted changes

* revert unwanted changes in sample

Co-authored-by: aani <aani>
2020-12-18 10:13:35 +08:00
Shinya Sugmoto
6a2ba0e615
test: enable typescript-axios integration test (#8163)
* test: enable typescript-axios integration test

* chore: update old dep & devDep

* refactor: use axios installed in test target

* chore(travisCI): update node version from v8.12.0 to v12.20.0
2020-12-17 11:38:19 +01:00
Peter Leibiger
a5377647f4
[dart][dart-dio] Add support for default values (#8201)
* [dart-dio] Generate default value builders

* return `null` when there is no default value instead of `"null"`
* use built_value's `_initializeBuilder` to set default values

* [dart-dio] Fix default value formatting in model doc
2020-12-17 17:50:36 +08:00
Aanisha Mishra
1562afea39
[GO][Client] return GenericOpenAPIError instead of error in Execute() (#8137)
* error to GenericOpenAPIError

* reformatted files

* reformat files

* spaces to tabs

* update petstore examples

* remove extra brackets

* update sample generation

* update go test cases

* update openapi3 go tests

* edit test samples

* update documentation
2020-12-17 16:39:43 +08:00
Peter Leibiger
96e6bc4650
[dart-dio] Allow dynamic headers and add additional dio parameters (#8191)
* fixes some compile errors due to header params not being of type `String`
* add optional `extra` and `validateStatus` parameters from dio
2020-12-16 23:24:09 +08:00
Hui Yu
f0c4fd7ab8
[C][Client] Fix coredump when releasing the memory of an incompleted resource (#8190) 2020-12-16 17:20:36 +08:00
Tomas Sykora, jr
180fae02cd
[DART-DIO] [GENERATOR] Make header params with dynamic types (#6915)
* Make header params with dynamic types

Otherwise this will generate code which is not compile-able. Like this:

```dart
        Future<Response<List<StockItemProjectionDirect>>>getAllStockItems(Store storeId,{ int xXChunkNumber,int xXChunkSize,StockItemRequestFilterDto stockItemRequestFilterDto,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {

        String _path = "/api/store/{storeId}/stock".replaceAll("{" r'storeId' "}", storeId.toString());

        Map<String, dynamic> queryParams = {};
        Map<String, String> headerParams = Map.from(headers ?? {});
        dynamic bodyData;

        headerParams[r'XX-Chunk-Number'] = xXChunkNumber;
        headerParams[r'XX-Chunk-Size'] = xXChunkSize;
```

See how the func recieves int argument which then assignes into a string... last 2 lines

* FIX: Dynamic header and sync with upstream

* DART-DIO new samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-16 17:13:50 +08:00
William Cheng
fb1661e451
update node-fetch (#8204) 2020-12-16 16:14:46 +08:00
Robert Parini
a4f84b2f8c
[Python][Client] Default to system CA instead of certifi (#8108)
* Use system CA by default and remove certifi

See https://github.com/OpenAPITools/openapi-generator/issues/6506

* Use system CA by default in asyncio client

* Update README_onlypackage.mustache

* Result of ./bin/generate-samples.sh

* Add ssl_ca_cert argument for Configuration

* Result of ./bin/generate-samples.sh

* Remove certifi, use system CA by default
2020-12-15 16:36:35 -08:00
Peter Leibiger
ddd11abb87
[dart][dart-dio] Correctly type responses and futures (#8195)
* don't rely on implicit dynamics
* this is a requirement for NNBD
* add space between return type and some method names
2020-12-16 00:52:47 +08:00
Hippolyte HENRY
81a5e44a6c
[ruby] Improve ruby client examples (#8040)
* [ruby] Improve ruby client examples

* samples

* quote fixes

* Keep enum value

* better string type handling

* fix failing tests

* add space after comment

* update samples

* use Time

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-16 00:10:04 +08:00
sahan
6f5076edb7
fix: use config basePath instead of the class context basePath (#8186)
* fix: use config basePath instead of the class context basePath

* chore: build samples
2020-12-15 10:54:13 +01:00
Peter Leibiger
f484e0db42
[dart][dart-dio] Formatting improvements (#8180)
* always add trailing commas in arrays and break each line
* make variables final
* improve API formatting (mainly leading spaces)
* remove empty lines and whitespaces
* fix formatting of datatype and description and docs
* consistently use single quotation marks (dart already does this)
2020-12-15 09:55:33 +08:00
Peter Leibiger
e412145a1f
[dart][dart-dio] More enum fixes for inner types (#8174)
* correctly generate enums from `mostInnerItems`
* use `datatypeWithEnum` which should always be he correct type
* dart generators prefix inner enums with the classname of the containing class, ensure datatypeWithEnum always matches
2020-12-14 23:05:31 +08:00
William Cheng
c974c512ff
[Spring] openapi-generator generates an incorrect stub for types named "Resource (#8178)
* Initial push for fix #1680

* fix yaml

* update samples

Co-authored-by: JBurgess <joel.burgess@gmail.com>
2020-12-14 20:16:25 +08:00
Peter Leibiger
351377ca29
[dart-dio] Fix x-www-form-urlencoded body not working (#8175)
* only use `FormData.fromMap()` for multipart content, `FormData` does not work with `x-www-form-urlencoded`
* use a basic map for `x-www-form-urlencoded` content
* fix formatting
2020-12-14 15:36:18 +08:00
Peter Leibiger
7f9012c554
[dart-dio] Use built_value collection types without string replacement (#8153) 2020-12-14 00:00:18 +08:00
Peter Leibiger
cd0257b0e5
[dart][dart-dio] Enum improvements (#8149)
* [dart] Always use the correct enum data type

* use raw strings for enum string values

* [dart-dio] Use raw strings for built_value enums

`@BuiltValueEnumConst` does some wierd string handling in the generated code `r'\$'` becomes `'$'`. This is different compared to the wireName in `@BuiltValueField`
2020-12-13 23:59:29 +08:00
William Cheng
d20d9447a8 update samples 2020-12-10 19:09:27 +08:00
Christophe Bornet
f2d8e3a25b
[Java/okhttp] Add dynamic operations option (#7916)
* Add dynamicOperations option to okhttp gen

* Add tests

* Add apiclient tests

* Fix apiclient template

* Add dependencies in gradle and sbt
2020-12-10 18:22:39 +08:00
Peter Leibiger
4ad6d0bfe5
[dart] Variable/Operation/Model naming (#8123)
* [dart] Properly escape param/var names that clash with Dart types

* [dart] Add tests for var/enumVar names

* note: public and private are no keywords in Dart
* some tests are still wrong, some are commented out

* Fix typo

* [dart] Improve variable name escaping

* add more tests

* [dart] Fix operationId naming

* [dart] Fix upper case var name with leading underscore

* [dart] Correctly support model prefix/suffix

* [dart] Support spaces in property names

* Call super for empty operationId

* [dart] Fix and improve enumVar naming/generation

* use same handling for all 3 generators
* allow `updateEnumVarsWithExtensions` to have access to the data type
* improve `x-enum-values` handling and add supprt for other enum vendor extensions
* remove duplicate and outdated tests from `DartDioModelTest`
* add more tests to `DartModelTest`
* no longer force lowercase enums for plain dart generator (breaking)
* this change also removes the trailing underscore from plain dart generator (breaking)
2020-12-09 23:21:08 +08:00
Peter Leibiger
2cdbfd63eb
[dart][dart-dio] Enum fixes specific to Dart DIO (#8114)
* [dart-dio] Fix wrong escaped serializer names

* [dart-dio] Prevent enum name collisions in inlined enums

Prefix the private built_value instances with the enum class name. Prevents clashes when multiple inline enums contain the same value - for example `EnumTest`.  No breaking changes here as all the changed fields/references are private and automatically re-generated with built_value.
2020-12-09 21:12:03 +08:00
William Cheng
2e70405084
update swift samples, use swiftlint 0.41.0 (#8138) 2020-12-09 18:19:27 +08:00
Peter Leibiger
144e08b4fc
[dart] Use raw strings for json/header parameter names (#8131)
This should fix all problems related to unescaped characters in strings that are assumed to be raw - e.g. `json[r'$special[property.name]']`
2020-12-09 11:12:48 +08:00
Josh Burton
7fb5e2538b
[dart-dio] Fixes errors when primitive return types are attempted to … (#7411)
* [dart-dio] Fixes errors when primitive return types are attempted to be deserialized as json

* Updates samples

* Removes old files
2020-12-09 11:07:29 +08:00
Sampo Kivistö
d1ea6ac839
[Csharp] Bugfix: Updated all C# templates ToJson method not to conflict reference withmodel properties (#8087)
* Updated all C# templates ToJson method not to conflict reference with model properties.

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-08 17:12:40 +08:00
Cody Mikol
f9d6c6fb21
CHORE[DEPENDENCIES]: bump swagger-parser => 2.0.22 (#7597)
this fixes a bug where the parser would return
null when missing parameters rather than reporting
some useful error.

Fixes N/A
2020-12-08 15:18:07 +08:00
fbl100
99d83712a8
Fixes issue #8014, _check_type flag not being honored. (#8053)
* Fixes issue 8014, _check_type flag not being honored.

Updated model_utils.mustache to pass the check_type flag into attempt_convert_item(). Failure to do so
results in type validation errors occurring when the user has specifically requested that they be disabled.

* regenerated samples

Co-authored-by: Frank Levine <frank.levine@blacklynx.tech>
2020-12-07 12:18:16 -08:00
Ülgen Sarıkavak
e00ac502f1
[python] Update python versions (#8042)
* Remove redundant encoding definitions

UTF-8 is already the default encoding in Python 3.

* Remove Python3.4 related requirements

* Remove dead Python version 3.5

* Add Python 3.9 to CI and test configs

* Update petstore example
2020-12-07 12:07:35 -08:00
itaru2622
35d616c9af
Fix bug [python][client] generated python client code cannot POST object in multipart/form-data (#8075)
* encode object in json and add content-type:application/json for multipart/form-data

fix issue https://github.com/OpenAPITools/openapi-generator/issues/8068

* update samples by ./bin/generate-samples.sh

* non-ascii chars supported in encoding object to json, and add "content-type:application/json; charset=utf-8"

* update samples again, by ./bin/generate-samples.sh

* update comment(docstring) in parameters_to_multipart according to the discussion in PR review.

* fix default value in parameters_to_multipart function as described in PR review comment.

* update samples again, by ./bin/generate-samples.sh
2020-12-07 09:50:09 -08:00
Peter Leibiger
751ffad8db
[dart] Cleanup and OAS3 support (#8085)
* [dart] Cleanup and regnerate old/wrong tests and docs

* docs path seems to be doc now in all dart generators
* generated tests are very old and use wrong classes

* [dart-dio] Improve formatting

* [dart][dart-dio] Restructure tests to same layout

* remove duplicate/old openapi sample for which there is no generation config
* generate to `petstore_client_lib` for both generators
* run generated tests as integration tests for dart2 even if empty - this makes it easier to find compile errors

* [dart] Improve gitignore handling for Dart generators

* globally ignore all dart related files that should not be commited
* remove old ignores that are no longer valid

* [dart][dart-dio] Add OAS3 generation and integration tests

Dart2 doesn't compile, needs fixes.

* [dart] Do not attempt to deserialize binary content from JSON fields

Not sure if that case is ever relevant but for now there doesn't seem to be a better option.

* [dart] Fix integration tests for OAS3 petstore

Some POST operations now return 200 with content.

* [dart] Generate Petstore Fake API but don't add to integration tests yet

Explicitly not adding the new integration tests to the master POM. They do not work but having them allows for quickly iterating on open issues without breaking existing basic OAS2/OAS3 petstore examples. Instead they should be run manually until everything is fixed.
2020-12-07 21:38:39 +08:00