11973 Commits

Author SHA1 Message Date
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
William Cheng
5451b77d42
[CodegenResponse] various enhancements and bug fixes (#10984)
* add more response tests, fix simpleType

* samples update

* replace simpleType with containerType

* update doc template

* fix typo in mustache tag
2021-12-05 17:43:17 +08:00
Yuriy Belenko
186842ea19
[php-slim4] Bump required PHP version to 7.4 (#11039)
* Change minimum PHP version to 7.4

* Refresh samples
2021-12-05 15:47:12 +08:00
Alexey Makhrov
03b4ac736f
[typescript-angular] taggedUnions=true: Support recursive schemas (#11016)
* typescript-angular: taggedUnions=true: Preserve import to the parent model from the child
if the child property has a direct reference to it

* Fix javadoc
2021-12-04 17:43:52 +01:00
WILLIAM CHENG
96ee13bbb2 replace tab with spaces 2021-12-04 14:43:32 +08:00
Peter Leibiger
ecddd4cff1
[dart][dio][built_value] Fix missing serializer factory builders for additionalProperties (#11011)
Refactor the addition of custom serializer factories.
2021-12-04 14:32:36 +08:00
Peter Leibiger
85985e8bfb
[dart][dio] Fix int64 based enums not correctly generated (#11014) 2021-12-04 14:31:55 +08:00
jzorn
8bc069778f
Compare security schema names case-insensitive (#10989)
According to RFC 7235 (HTTP/1.1: Authentication), schema tokens are
handled case-insensitive (Section 2.1: Challenge and Response). This
change compares the known token values basic, bearer, and signature
case-insensitive.

- https://datatracker.ietf.org/doc/html/rfc7235#section-2.1
2021-12-04 13:18:06 +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
Abrhm7786
6bc7390914
Azure functions (#11020)
* New branch

* Added test class for functions server

* Logger should not be static

* Added csharp-netcore-functions to docs/generators

* Added csharp-netcore-functions to generators.md

* Removes sln and csproj
2021-12-04 13:05:30 +08:00
Tal Kirshboim
3719035787
Fix HTTP client configuration object freezing issue on iOS (#11012) 2021-12-04 12:56:40 +08:00
Justin Black
836e40f1d2
Fixes CodegenMediaType schema baseName (#11030) 2021-12-03 10:21:36 -08:00
cghislai
b915ad99a8
typescript-angular: Add supports for v13 (#10877) 2021-12-03 09:10:40 +01:00
jiangyuan
ef31941b13
fix file path (#11005)
Co-authored-by: jiangyuan04 <jiangyuan04@baidu.com>
2021-12-02 08:50:52 -08: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
Justin Black
8702f24f05
Adds request body content data to allow multiple content types to be sent to servers (#10973)
* Adds CodegenMediaType and CodegenEncoding

* Adds partial new code to set Parameter content data

* Adds content to CodegenParameter

* Sets content for request bodies

* Adds testParameterContent

* Adds testRequestBodyContent
2021-11-29 09:31:38 -08:00
Alexander Karkossa
8e2e200e18
fix: changed Any to kotlin.Any (#10985) 2021-11-30 00:42:22 +08:00
WILLIAM CHENG
3b5345eb57 update option value in ruby generator 2021-11-27 10:03:27 +08:00
Tal Kirshboim
ae911ff2c1
Support generated gradle module as child module (#10966) 2021-11-27 09:36:19 +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
Justin Black
06faa289bd
Adds codegenParameter.schema to allow referenced schemas in parameters (#10934)
* Removes python-experimental folder

* Sets schema in fromParameter

* Sets schema in codegenParameter

* Adds tests of schema
2021-11-25 18:00:53 -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
Hui Yu
375f0a5c2d
[C][Client] Use cpack to build deb package (#10935) 2021-11-24 17:42:04 +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
Tal Kirshboim
3a12b6144f
Fix enum generation (#10923) 2021-11-23 21:04:43 +08:00
cyangle
8338962deb
[crystal] Add annotation to reserved key word list of crystal lang (#10932)
* add annotation to reserved key word list of crystal

* Update crystal docs
2021-11-23 21:02:49 +08:00
Tomáš Čermák
e5159ef8d5
[Protobuf-Schema] Add numbered field number list switch (#10893)
* [Protobuf-Schema] Add numbered field number list switch

* [Protobuf-Schema] Add numbered field number list switch

* [Protobuf-Schema] Added switch

* [Docs][Protobuf-Schema] Generated docs

Co-authored-by: Tomáš Čermák <cermak@merica.cz>
2021-11-23 10:43:34 +08:00
Jens L
49e9911b3f
[typescript-fetch] fix circular imports being generated (#10798)
templates based off of #6140 and @ajaska

closes #6140
2021-11-22 13:17:15 -08:00
Tomasz Prus
e9f2ccde67
[Python] Add option to select content-type using body or force it for… (#10686)
* [Python] Add option to select content-type using body or force it for API call

* Add support for application/json-patch+json

* Add unittests.
2021-11-22 08:41:04 -08:00
Tomáš Čermák
c13067d100
[Protobuf-Schema] Add unknown to enum switch (#10892)
* [Protobuf-Schema] Add unknown to enum switch

* [Protobuf-Schema] Bugfix: unique unknown by prefix

* [Protobuf-Schema] Add unknown to enum switch

* [Protobuf-Schema] Bugfix: unique unknown by prefix

* [Protobuf-Schema] Bugfix after merge, format file

* [Docs][Protobuf-Schema] Generated docs

Co-authored-by: Tomáš Čermák <cermak@merica.cz>
2021-11-22 21:57:33 +08:00
Felix Winterhalter
c7bd3aa294
fix: Support Netcore 6.0 (#10634) 2021-11-22 16:56:57 +08:00
Tomáš Čermák
fdea71b26e
[Protobuf-Schema] Add enum as model support (#10868)
* [Protobuf-Schema] Add enum as model support

* [Protobuf-Schema] Bugfix: Reverted classname modification

* [Protobuf-Scheme] Mustache newlines update

* [Protobuf-Schema] Renamed addModelEnumIndexes to addEnumIndexes

* [Protobuf-Schema] Add enum as model support

* [Protobuf-Schema] Bugfix: Reverted classname modification

* [Protobuf-Scheme] Mustache newlines update

* [Protobuf-Schema] Renamed addModelEnumIndexes to addEnumIndexes

Co-authored-by: Tomáš Čermák <cermak@merica.cz>
2021-11-22 16:29:09 +08:00
Ian Cubbon
6779c33b9d
[GO][Client] Multipart/form-data Request Support More Than One File (#10843)
* Instead of limiting a request to a single file when
performing an upload, use a slice of files so an
arbitrary number of files can be used in the form.

* Remove commented out line of code

* Update examples for multi-form file fix for multiple files

* Convert spaces to tabs for indentation

* Updated examples to have tabs instead of spaces

* Add an example of a multipart/form-data OA3 schema
that contains two files to be uploaded
2021-11-22 16:27:43 +08:00
William Cheng
c244c23053
better null comparison (#10915) 2021-11-21 23:03:25 +08:00