1199 Commits

Author SHA1 Message Date
Peter Leibiger
fbe2bb7c97
[dart][dart-dio] API class/template refactoring (#8825)
* [dart][dart-dio] Refactor API template

* first construct a `RequestOptions` instance with all parameters etc. inline
* then construct and serialize the body data
* then send the request and await the response
* then deserialize the response
* always use the `specifiedType` for built_value (de)serialization instead of a mix of ways (this does the same as finding the serializer directly)
* use indent of 2 spaces (as per Dart convention)
* prefix all local variables to prevent name clashes with parameters

* Add tests that (de)serialize collections and add API key header
2021-02-25 20:24:21 +08:00
agilob
9fc33f6a73
[Dart] Add configuration to add new generators and add json_serializable (#8789)
* Add Dart configuration flag to set new generator

* Change templates to add json_serializable generator

* Fix dart tests

* Add custom serialization for standard generator

* this change opens us a way to allow adding more than 2 generators

* Add sample project for json_serializer

* Use basename for json field name

* Update samples with basename as json key

* Update dart generator docs

* Create AbstractDartCodegen class

* Update docs, dart-dio and dart-jaguar dont get json_serializable yet

* Deduplicate method calls

* Dix dart-dio generation

* Revert formatting change in dart mustache

* Fix formatting changes again

* Improve dart serialization documentation

specify default serializer

* Better name for cli option

* Rename default dart generator to 'native'

* Another attempt to reduce whitespace noise

* Fix api-client and api-helper

* Rename default serialization mode to include word serialization

* Remove trailing whitespace in enums
2021-02-25 17:11:16 +08:00
Adrien CABARBAYE
a31dba5b88
[GO] use latest available oauth2 version (#8764)
* [GO] use latest available oauth2 version

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-02-25 02:32:49 +08:00
Thomas Hervé
f9b1f98d21
Fix base type naming in Go (#8819)
Go generation didn't properly named base type in `getSchemaType`, which
ends up breaking some doc generation.
2021-02-25 02:31:59 +08:00
Peter Leibiger
4f4f1d4128
[dart][dart-dio] Remove manual json encode/decode calls in API classes (#8812)
* [dart][dart-dio] Remove manual json encode/decode calls in API classes

Dio automatically adds a default transformer which does call `json.encode` and `json.decode` when the content-type is `application/json`. When the content-type is different, then it  is up to the consumer to configure the Dio instance correctly to support custom content-types.

Also tests!!!

* [dart] Constraint test library to < 1.16.0 as it requires Dart 2.12.0

* Fix more constraint problems for the new test project
2021-02-24 23:29:41 +08:00
William Cheng
c653051997
Revert "[Ruby] force users to specify the temp folder path to address security concerns (#8730)" (#8807)
This reverts commit 18a6f5a941f3b5777977693f3b59ac5d200928a8.
2021-02-24 00:31:43 +08:00
Ronny Pfannschmidt
eb3d6d2f16
[python][template] move _path_to_item of simple init to avoid name error (#8737)
* [python][template] move _path_to_item of simple init up so its avaliable for missing default errors

* update generated examples
2021-02-22 21:00:14 -08:00
William Cheng
1b6cabb97d
[Java] use Files.createTempFile instead (#8787)
* use Files.createTempFile

* fix import

* add missing import
2021-02-23 11:40:37 +08:00
William Cheng
e9d4886e70
replace tab with spaces, minor code format change (#8775) 2021-02-21 12:14:52 +08:00
William Cheng
ea428d6048
update jackson dependencies to address security issues (#8778) 2021-02-21 11:40:24 +08:00
William Cheng
ba4aae5074
[Go] bug fix (breaking), minor code format enhancement (#8715)
* go minor code format enhnacement

* fix required vars in the model new

* remove comma
2021-02-20 11:50:27 +08:00
William Cheng
18a6f5a941
[Ruby] force users to specify the temp folder path to address security concerns (#8730)
* address security issue when downloading files in the ruby client

* update samples

* fix double quote
2021-02-20 11:49:10 +08:00
William Cheng
d19bfebeda
replace tabs with 4-space in dart templates (#8740) 2021-02-19 18:02:54 +08:00
Peter Leibiger
c916df9381
[dart][dart-dio] Nullable support/improvements (#8727)
* [dart-dio] Disable nullable fields by default

This is not in line with the OAS and will prevent future Dart nullabilty features (NNBD) from being useful as all types would be optional.
Users can still opt-in for this.

* [dart-dio] Properties are nullable when not required AND not nullable

* [dart][dart-dio] Support nullable/required fields

* properties in built_value need to be nullable when they are nullable in OAS or when they are not required in OAS
* built_value does not support serializing `null` values by default as it is based on a serialization format based on iterables/lists and not maps
* dart-dio uses the built_value json plugin to convert the built_value format to regular json
* by generating a custom serializer for each class we can add support for serializing `null` values if the property is required AND nullable in OAS
* this is a breaking change as not all properties in the models are nullable by default anymore

* Implement required/nullable for dart

* Changes for set types and enum names after rebase

* Add some comments and fix built_value fields with default being nullable

* More rebase changes and regenerate docs
2021-02-17 21:44:21 +08:00
Peter Leibiger
7704ff3d08
[dart][dart-dio] Allow API key authentication with multiple API keys (#8728)
Remove the break stopping after the first key.
2021-02-17 21:40:27 +08:00
Oleh Kurpiak
135c8f45a4
[Java][native] extend native ApiClient (#8557) 2021-02-16 21:47:44 +08:00
Peter Leibiger
683dcb8889
[dart][dart-dio] Raise min Dart to 2.7.0 & update built_value constraint (#8684)
* raise min Dart version to 2.7.0 / Flutter 1.12.0
* update constraints for built_value to support new major versions with null safety
2021-02-16 18:00:59 +08:00
Peter Leibiger
608242b4d8
[dart][dart-dio] Improve prefixing of inner enums with classname (#8685)
* [dart][dart-dio] Improve prefixing of inner enums with classname

* prevent further name conflicts by correctly naming the enum, until now there could potentially occur conflicts e.g. 2x `MapTestInnerEnum` by renaming the `items` child property
* correctly set `enumName` to match `datatypeWithEnum`

* Unrelated test regeneration
2021-02-16 17:59:54 +08:00
William Cheng
53285e5aa5 update samples 2021-02-16 08:15:04 +08:00
David Hontecillas
51c8fd1520
Fix generated go client cannot upload file (#8393)
* go client send **io.File body

* run generate-samples for Go upload fix
2021-02-16 08:08:27 +08:00
Moshe Elisha
90e8dcf3e3
[JAVA][native] - Fix #8027 - import the auto generated supporting JSON class only when discriminator is needed (#8554)
* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Revert "Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true"

This reverts commit 56e2b1fb

* Revert "Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true"

This reverts commit 335c304d

* Fix #8027 - import the auto generated supporting JSON class only when generateSupportingFiles is true

* Fix #8027 - import the auto generated supporting JSON class only when discriminator is needed

* Fix #8027 - import the auto generated supporting JSON class only when discriminator is needed

* Fix #8027 - import the auto generated supporting JSON class only when discriminator is needed
2021-02-12 23:02:13 +08:00
William Cheng
b4f4d7434b Merge remote-tracking branch 'origin/master' into 6.0.x 2021-02-12 18:48:20 +08:00
miyucy
3c4b1a0c4c
Fix syntax error (#8675)
Added missing closing brace in list_invalid_properties model method.
2021-02-11 23:43:19 +08:00
Reinhard-PTV
6fdd8ea3da
Fixed serialization of date-time query parameters. (#8616) 2021-02-08 23:03:29 +08:00
Reinhard-PTV
df107e2244
Do not use context timezone. (#8614) 2021-02-08 19:25:58 +08:00
William Cheng
3e81876e2c Merge remote-tracking branch 'origin/master' into 5.1.x 2021-02-06 17:52:32 +08:00
William Cheng
c7fcb39a2d
Prepare v5.0.1 release (#8627)
* release 5.0.1

* update samples
2021-02-06 16:37:22 +08:00
William Cheng
21d7330aea update samples 2021-02-06 14:55:43 +08:00
Žilvinas Urbonas
90e25f6f4c
[BUG][Python] init access token for python client configuration (#7469)
* fix: init access token for python client configuration

* fix: remove duplicate initializations for access_token
2021-02-05 13:09:53 -08:00
Aanisha Mishra
d869544ce1
[Go][Client] Secret key content string in http signing support (#8570)
* accept private key content string

* sample update

* Add comments to new methods

* update samples with comments

* Update modules/openapi-generator/src/main/resources/go/signing.mustache

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>

* Update modules/openapi-generator/src/main/resources/go/signing.mustache

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>

* Update signing.mustache

* update sample comments

* Update modules/openapi-generator/src/main/resources/go/signing.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* Update modules/openapi-generator/src/main/resources/go/signing.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>

* update empty checks for privateKey

Co-authored-by: Vikrant Balyan <vvb@users.noreply.github.com>
Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>
Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2021-02-04 10:33:17 +08:00
Bruno Coelho
45fc02350b
[kotlin] fix Date types usages (#8594)
* [kotlin] fix Date types usages
2021-02-02 20:55:51 -05:00
William Cheng
2c457a458e Merge remote-tracking branch 'origin/5.1.x' into 6.0.x 2021-02-02 21:43:53 +08:00
William Cheng
5b99d8724c Merge remote-tracking branch 'origin/master' into 5.1.x 2021-02-02 21:04:15 +08:00
Peter Leibiger
1b440e191c
[dart-dio] Improve API & API-Client field initialization (#8589) 2021-02-02 18:46:51 +08:00
Peter Leibiger
769b0e0e38
[feature][dart] Add support for uniqueItems/sets (#8375)
* [dart][dart-dio] Add support for set types

* copy `uniqueItems` usage from 2.0 fake spec to `3.0`
* add support for sets in parameters, responses and properties

* Regenerate all other samples

* Fix broken tests due to invalid cast

* Update documentation

* Regenerate samples

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-02-02 18:42:45 +08:00
Peter Leibiger
26f21bb6a0
[dart-dio] Add missing isRedirect parameter to response (#8588) 2021-02-01 22:29:20 +08:00
Peter Leibiger
5135967c91
[dart] Fix typo added in 57126a19 (#8581) 2021-01-30 11:32:33 +08:00
adpoliak
a4312412fc
[PYTHON] use customized default Configuration() objects if configured by the programmer (#8500) 2021-01-29 16:24:10 -08:00
Oleh Kurpiak
f0b9e21b6b
[Java] fix generation for JavaTimeFormatter (#8348)
* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter

* [Java] fix generation for JavaTimeFormatter
2021-01-29 11:22:37 +08:00
NANASHI0X74
57126a1900
Add getters for private default Headers and authentications (#8509)
* add getters for default headermap and auths

* regenerate samples, make shebangs portable

* Revert making shebangs portable

This reverts commit ec60f603598abf0f57dfdb6ca55b4d5c1ee25edf.

Co-authored-by: nanashi0x74 <rian.lindenberger@mpq.se>
2021-01-29 10:58:07 +08:00
Justin Black
2553d056dc
Removes nulltype from python, updates samples (#8555)
* Removes nulltype from python, updates samples

* Removes nulltype from the python requirements

* Removes nulltype import in models, moves requiredVars to optionalVars when approprieate
2021-01-28 09:30:36 -08:00
William Cheng
694b10e41c Merge remote-tracking branch 'origin/5.1.x' into 6.0.x 2021-01-28 16:47:55 +08:00
William Cheng
d97717ee24 Merge remote-tracking branch 'origin/master' into 5.1.x 2021-01-28 15:52:44 +08:00
William Cheng
7654356df2
Migrate elixir samples to use OAS v3 (#8538)
* use 3.0 spec for testing

* add new files

* add 200 responses

* update samples, better code format for jaxrs
2021-01-27 11:14:58 +08:00
William Cheng
84813be309
remove supportJava6 option (#8514) 2021-01-26 10:27:09 +08:00
Peter Leibiger
201acbd3de
[dart] Fix switch on enums not possible (#8512)
All enum instances are `const` so `equals/hashCode` is not needed.
Removing this allows to `switch/case` on enum instances.
2021-01-25 18:31:19 +08:00
Kuzma
57227e510f
Remove servers urls with trailing slash (#7940)
* remove trailing slash

* update sample app

* added tests

* bug fix

* Adds test in DefaultGeneratorTest

* Reverts python files

* Does not modify a value of /

* Stops skipping / use case

* update samples

Co-authored-by: Justin Black <justin.a.black@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2021-01-25 13:32:39 +08:00
Christophe Bornet
06ad7a51ef
[Kotlin-Spring] Fix properties default value (#8373)
* [Kotlin-Spring] Fix properties default value

* Fix kotlin enum default

* Update go sample
2021-01-24 22:43:58 +08:00
SBNTT
96da7aaf9d
--http-user-agent arg support in dart generator (#8508)
* add User-Agent header

* set User-Agent header only if httpUserAgent is defined

* add User-Agent header in dart-dio generator

* update samples
2021-01-23 10:39:21 +08:00
Peter Leibiger
90ed1290fa
[dart][dart-dio] Improve form param handling, respect required flag (#8369)
* [dart-dio] Improve form param handling, respect required flag

* simplify template
* respect required flag (only null check when not rquired)
* minor formatting

* Add additional nullable check
2021-01-22 17:58:27 +08:00