7223 Commits

Author SHA1 Message Date
Mostafa Moradian
fedc54af9a
[K6 Generator] various enhancements (request body example data extraction, support for generating scenario tests and load tests out of the box, and much more) (#11106)
* Further K6 OpenAPI generator enhancements

 * request body example data extraction
 * request grouping and ordering
 * response visibility
 * request data extraction for chaining requests

Signed-off-by: Michael H. Siemaszko <mhs@into.software>

* Further K6 OpenAPI generator enhancements

 - regenerated samples

Signed-off-by: Michael H. Siemaszko <mhs@into.software>

* Fix suggested changes by linter

* Fix extra spaces in the template

* Log exception

* Rename function signature to camelCase

* Address comments on Big-O

* Move declaration of variable near the usage

* Add config file for generating k6 script

* Regenerate k6 script

* Regenerate samples

* Fix predicate

* Fix missing import

Co-authored-by: Michael H. Siemaszko <mhs@into.software>
2021-12-17 10:18:10 +08:00
William Cheng
b2daa5a836
update jackson-databind-nullable to 0.2.2 (#11121) 2021-12-15 11:41:16 +08:00
William Cheng
e5d58a35a2
update dependencies to newer versions (java) (#11116) 2021-12-14 18:32:37 +08:00
basyskom-dege
8fbd11073a
[QT][C++]fixed integration test for Oauth (#10921)
* fixed missing package, fixed namespace issues

* using older function to check if token is valid

* using time.h to check if token is valid
2021-12-14 18:23:18 +08:00
Bruno Coelho
eb224db540
[kotlin][client] remove old Date usage (#11082)
* [kotlin][client] remove old Date usage

* [kotlin][client] remove old Date usage
2021-12-14 16:03:12 +08:00
Bruno Coelho
5416e92d19
[swift5][client] add support for async/await in iOS 13 and above (#11109) 2021-12-14 15:58:19 +08:00
William Cheng
fbb61658df
[kotlin][client] rename ApiInfrastructureResponse to ApiResponse (#11094)
* rename ApiInfrastructureResponse to ApiResponse

* mark ApiResponse as reserved word

* update samples, docs

* fix typo
2021-12-12 16:32:08 +08:00
Bruno Coelho
3247903caa
[kotlin][client] update request exceptions (#11065) 2021-12-11 21:48:59 +08:00
Guus Bloemsma
0236f84c11
[kotlin-client] Allowing vendor types for json (#10758)
* Using the first serializable 'consumes' mediaType
Using all deserializable 'produces' mediaTypes
Matching json vendor types as json

* updating the generated samples
2021-12-11 21:48:00 +08:00
Justin Black
cee5f75912
Feat adds content and header properties to CodegenResponse (#11046)
* Adds responseHeaders to codegenResponse

* Sets response headers in codegenResponse

* Samples updated

* Adds test of response headers

* Adds content to CodegenResponse

* Sets codegenResponse content

* Tests added, test content-data.yaml spec update

* Adds mediaTypeSchemaSuffix input to getContent

* Tests updated

* Updates how response content schema names are set

* Adds missing Locale to String.format invocations
2021-12-10 13:49:29 -08:00
Deniz Dogan
c94d2b2331
[swift5] Fix missing case for FormDataEncoding#encode (#11064)
Fixes #11062
2021-12-10 14:08:32 +08:00
William Cheng
550c0781dc
[okhttp-gson-next-gen] new option for error object (#10995)
* add error body and type to api exception class

* add option to specify error object

* add option, update api doc with better error handling

* update samples

* update doc
2021-12-10 02:08:17 +08:00
Tomasz Prus
b755ae288a
[Python] Add option to select/detect content-type. (#10978)
* [Python] Add option to select/detect content-type.

* Regenerate samples after rebase.

* Update samples.

* test: fix assertion
2021-12-08 13:15:26 -08:00
Justin Black
347b75a024
Fixes paramName and dataType for request body anyType parameters (#11075)
* Adds request body of any type

* Fixes param dataType, paramName, and baseName

* Uses updateRequestBodyForPrimitiveType as the else case for anyType request bodies like the code used to do

* Samples updated

* Samples regenerated
2021-12-08 13:03:08 -08:00
Bruno Coelho
c941044701
[swift5][client] allow request cancellation and authentication flow to work together (#11019)
* [swift5][client] allow request cancellation and authentication flow to work together

* [swift5][client] allow request cancellation and authentication flow to work together

* [swift5][client] rename OpenAPIRequestCancellable to RequestTask

* [swift5][client] rename OpenAPIRequestCancellable to RequestTask
2021-12-09 01:07:49 +08:00
William Cheng
2ff6f833e2
add more tests for oneOf (#11068) 2021-12-08 09:39:42 +08:00
William Cheng
a489a2e828
[java][okhttp-gson-next-gen] better error message in oneOf/anyOf (#11059)
* better error message

* update tests
2021-12-07 21:38:54 +08:00
William Cheng
192126be6b
[java][okhttp-gson-next-gen] fix serialization, add tests (#11057)
* fix serialization, add tests

* add new files
2021-12-07 16:22:46 +08:00
William Cheng
000a18d3b9
[java][okhttp-gson-nextgen] Better null handling in oneOf, anyOf model (#11056)
* better null handling in oneOf model

* update anyof with better null handling

* add null test
2021-12-07 15:11:06 +08:00
William Cheng
0eec937845 update samples 2021-12-07 00:28:43 +08:00
William Cheng
e00efe7c8d Merge remote-tracking branch 'origin/5.4.x' into 6.0.x 2021-12-07 00:12:13 +08:00
William Cheng
676da0e778 update samples 2021-12-07 00:11:40 +08:00
William Cheng
2b7910c875 Merge remote-tracking branch 'origin/master' into 5.4.x 2021-12-06 23:57:07 +08:00
William Cheng
95377f68bf
[C#][functions] minor improvements. (#11034)
* better code format

* mark generator as beta

* update readme

* minor code format change

* remove docs

* add Docs

* remove docs

* add back docs

* mv yaml
2021-12-06 23:18:48 +08:00
Tal Kirshboim
8fc6172c6d
Build and test Kotlin Multiplatform samples in CI (#11023) 2021-12-04 13:06:37 +08:00
Jarrod Parkes
15f45711a8
add swift5 option for generating frozen enums (#11013)
* add swift5 option for generating frozen enums

* use case unknownDefault to avoid conflicts

* update comments to reflect unknownDefault case

* set default values for unknown case to avoid conflict

* dont need vendor extensions to detect enum raw data type

* move CaseIterableDefaultsLast into models mustache template

* comment catch all case and add support for other types

* add frozen enums to ci pipeline

* remove extraneous edit to extensions template

* remove left over protocols files

* small comment and case adjustments
2021-12-04 13:05:51 +08:00
Tal Kirshboim
3719035787
Fix HTTP client configuration object freezing issue on iOS (#11012) 2021-12-04 12:56:40 +08:00
cghislai
b915ad99a8
typescript-angular: Add supports for v13 (#10877) 2021-12-03 09:10:40 +01:00
Deniz Dogan
56e7f811bc
Add Hashable to oneOf enums (#10971)
Fixes #10970
2021-12-01 14:49:00 +08:00
William Cheng
a745f053bd
skip custom adapter for parent object (#10998) 2021-12-01 14:20:39 +08:00
Fumito Nakazawa
a24d314006
[swift5] Use enum as parameter instead of raw type (#10967)
* Fix enum type

* Remove operation_id

* Fix samples
2021-12-01 00:34:15 +08:00
William Cheng
b061bd2146
[Java][Okhttp] Add oneOf support (#10875)
* add custom gson deserializer

* add check for additional fields, required fields

* add tests for custom deserializer

* add custom adapter

* add custom adapter

* register type adapter factory

* comment out custom deserializer and use adapter instead

* add okhttp-gson-nextgen

* add new files

* restore okhttp-gson

* switch to adapter

* remove custom de/serializer

* add comment

* update tests

* test nextgen in ci

* update doc

* use full model name in JSON.java

* undo changes

* add oneof discriminator support

* fix anyOf

* remove mappings

* add more tests

* fix oneof deserialization, add more tests

* add error body and type to api exception class

* JSON to use instance variables/methods

* Revert "add error body and type to api exception class"

This reverts commit 07f34e2c450ad9f808b728173018b1e4d8fed458.
2021-11-30 15:33:42 +08:00
jiangyuan
e7ac0eec4b
[Python] fix model.mustache import (#10988)
* fix model.mustache import

* add samples file change

Co-authored-by: jiangyuan04 <jiangyuan04@baidu.com>
2021-11-29 17:50:19 -08:00
Tal Kirshboim
6406e5c031
[Kotlin][Multiplatform] Support custom Ktor HTTP client configuration (#10968)
* Support using a custom Ktor HTTP client configuration

* Remove ApiClient.kt secondary constructor
2021-11-30 09:33:42 +08:00
Alexander Karkossa
8e2e200e18
fix: changed Any to kotlin.Any (#10985) 2021-11-30 00:42:22 +08:00
Kevin Chen
3d92df5a41
[Java][okhttp-gson] Support text/plain body (#10885)
* support serialize RequestBody with contentType text/plain

* add Serialize test

* update test comment
2021-11-26 15:04:19 +08:00
Fumito Nakazawa
a620853216
[swift5] Refactor encodeToJSON (#10961)
* Add protocol extension method

* execute sample script

* Add Packing.cmake

* Revert "Add Packing.cmake"

This reverts commit cb52547fe34c5d17dd83267daa259b7ee3ddd503.

* Remove empty lines

* Revert FILES

* Add Packing.cmake
2021-11-26 00:55:06 +08:00
Berlin Cho
8e303150ae
[Java][resttemplate] Support URL queryParams Comma encoding (#10958)
* Java Encode comma (with unit tests)

* fix PMD warnings
2021-11-25 16:12:55 +08:00
Steve Mason
5bd0452893
[Java][Native] Drain InputStream when no response is being read (#10956)
The [docs for ofInputStream](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.BodySubscribers.html#ofInputStream()) say:

> To ensure that all resources associated with the corresponding exchange are properly released the caller must ensure to either read all lines until the stream is exhausted, or call BaseStream.close() if it is unable or unwilling to do so. Calling close before exhausting the stream may cause the underlying HTTP connection to be closed and prevent it from being reused for subsequent operations.

When ObjectMapper.readValue is called with an InputStream it implicitly closes it, but when the library is not expecting a return type it's not passing the InputStream to Jackson, so the stream needs to be manually drained and closed as per the docs

Failure to do this leads to a leak of HttpClient socket handles, and ultimately the exception `java.net.BindException: Cannot assign requested address` when trying to make API calls
2021-11-25 14:44:57 +08:00
AJ Rice
08eaafa871
Add operation level servers support for java okhttp-gson client (#10925)
* Add Operation Servers to {operation}Call method

* add getter/setter methods

Add methods for hostIndex and customBaseUrl

* Fix return types for getters

* Add custom baseUrl logic

if you dont specifically declare a custom base url using the set method then it uses the 1st server in the operation host index array

if no custom url is set and the operation base path array is empty however, the call throws an exception

* Update server selection logic

First checks to see if a custom url is provided

If not, checks to see if operation level server is defined and uses the supplied host index (default 0)

If neither is supplied, uses the ApiClient default base path

* Update samples and docs
2021-11-25 14:17:50 +08:00
William Cheng
1953e70661
[C#][netcore] minor code improvement (#10951)
* minor code improvement

* better code format
2021-11-25 13:28:33 +08:00
Brian J. Miller
2e47f3e84c
Allows install typescript-axios client via npm from Git (#10890) 2021-11-24 06:48:21 -08:00
dever4eg
1314e229f5
Fixed http errors deserialization (#10940)
* Fixed http errors deserialization

I've found this bug in @kubernetes/client-node npm package.

By the way, Here is the issue https://github.com/OpenAPITools/openapi-generator/issues/2924#

* Update typescript-node samples with a fix of error handling

* Update samples version

Co-authored-by: Bogdan Onischenko <bogdan.onischenko@nixsolutions.com>
2021-11-24 06:46:41 -08:00
WILLIAM CHENG
887fe07bc1 upadte samples 2021-11-24 17:47:31 +08:00
WILLIAM CHENG
962e8c4217 update samples 2021-11-24 17:24:19 +08:00
Sheldon Young
d01ad0524c
[rust] Update to modern hyper and futures crates (#9919)
* [rust] Update to modern hyper and futures crates

* [rust] Update to modern hyper and futures crates
2021-11-24 17:20:44 +08:00
William Cheng
af0babf892
[C#][netcore] various improvements in HttpSigningConfiguration.cs (#10941)
* various improvements in HttpSigningConfiguration.cs

* update returns in xml comments
2021-11-24 16:14:29 +08:00
Tomasz Prus
ca848871da
[Python] Add missing Mock library for Python 2.7. (#10939)
* [Python] Add missing Mock library for Python 2.7.

* Update template for test-requirements.txt.
2021-11-24 15:54:25 +08:00
Fumito Nakazawa
64a478a93c
[swift5] Remove optional from body (#10938)
* Unwrap body

* Remove unsupported type from nonDecodableBuilder

* Update samples

* Remove !

* Fix typo
2021-11-23 21:18:56 +08:00
Fumito Nakazawa
faae00df91
[swift5] Refactor some codes (#10937)
* Use compactMap

* Remove as Any cast

* Remove array

* Update samples
2021-11-23 21:18:42 +08:00