11973 Commits

Author SHA1 Message Date
Alan Morgan
9f4f2fde47
[GH-11032] Bug - Allow query parameters than contain spaces for Java client. (#11160)
The java client doesn't allow query parameters that have a value of just "%20"
or "%0A". Those can now be values with this commit.
2022-01-02 17:23:39 +08:00
William Cheng
5f5a83a592
fix enum name in okhttp-gson-nextgen (#11210) 2022-01-02 16:37:16 +08:00
William Cheng
12e03b1937 Merge remote-tracking branch 'origin/master' into 6.0.x 2022-01-02 15:41:37 +08:00
sullis
8d532d5a38
[scala-gatling] use the official Gradle plugin (#11208) 2022-01-02 14:53:30 +08:00
Jarrod Parkes
9c3cba9b86
[swift5] Add property x-null-encodable extension for full control over encoding value/nil or nothing (#11141)
* feat(ISSUE-11033): add null encodable type and mustache changes

* feat(ISSUE-11033): regen all swift5 samples

* feat(ISSUE-11033): add swift5 examples of null encodable

* feat(ISSUE-11033): fix hashable and compliation issues

* fix(ISSUE-11033): fix tests by using new enum encodeValue

* fix(ISSUE-11033): fix tests by using new enum encodeValue

* fix(ISSUE-11033): revert status back in pet api test

* fix(ISSUE-11033): fix issue with objc compat generator

* feat(ISSUE-11033): restore default values to null encodables

* chore(ISSUE-11033): rename default value for null encodable

* chore(ISSUE-11033): add test cases with different nullable defaults
2022-01-02 14:51:15 +08:00
Hiromi Hishida
8a3b434d54
[php] Handle \SplFileObject before primitive(to avoid php8 settype() error) (#11184)
* Handle \SplFileObject before primitive(to avoid php8 settype() error)

* Add test case

* Add array check to fix type error

Code throws error:
array_key_exists() expects parameter 2 to be array, null given
When $httpHeaders argument is null.

Co-authored-by: Yuriy Belenko <yura-bely@mail.ru>
2021-12-30 13:57:01 +03:00
Šimon Lukašík
08773a211c
Rust Client: Support collectionFormat="multi" (#11169)
Previously, rust-client generator disregarded collectionFormat property of
multi-value parameters. Now we support following values in collectionFormat: "",
"csv", "multi".

You can review changes this creates for fairly sizable project at https://github.com/CrowdStrike/rusty-falcon/pull/33/files
2021-12-29 11:50:08 +08:00
Yuriy Belenko
aa61220db2
[php-slim4] Add dependency injection container 2 (#11159)
* Change packages order alphabetically

* Add PHP-DI package to Composer template

* Remove ContainerInterface from APIs

User shouldn't access container directly, it's an anti-pattern.

Ref: https://php-di.org/doc/best-practices.html#rules-for-using-a-container-and-dependency-injection

* Change app templates to use PHP-DI

Application looks more like a default Slim skeleton now.

Ref: https://github.com/slimphp/Slim-Skeleton

* Rename SlimRouter to RegisterRoutes

Since it's callable class new name fits better.

* Add short documentation

* Refresh samples
2021-12-29 10:57:19 +08:00
Jason Kaiser
02a51579be
[typescript-angular] Support blob response types (#11085)
* Fixed issue 11021 by changing the responseType to blob for accept headers that don't match text or json.

* Updated samples.

* Updated inline json pattern matching with an existing utility method.

* Updated samples.

* Fixed isJsonMime call.

* Updated samples.

* Fixed default response type of json when accept header is not given.

* Updated samples.
2021-12-24 16:51:31 +01:00
Vesa Poikajärvi
7ffd0711c3
[typescript-axios] Add option to add NodeJS imports (#10990)
* [typescript-axios] Add new option to generate imports from 'url'

* Added new option `withImportUrl` to be used to generate the imports needed
  for NodeJS support without adding DOM to TypeScript libs

* [typescript-axios] Add withImportUrl support to templates

* Generate imports from 'url' if withImportUrl is set to true

* [typescript-axios] Generate new samples using withImportUrl

* [typescript-axios] Add withImportUrl to documentation

* [typescript-axios] Regenerate docs, build was still ongoing and used old param name

* [typescript-axios] Rename withImportUrl to withNodeImports

* Rename the parameter to support other Node imports
* Add imports for form-data too if using multipartFormData
* Add fix for multipart headers when running in Node with form-data package
2021-12-24 16:49:36 +01:00
David Gamero
0bbd1e59e9
useSingleRequestParameter should mark parameter optional if all properties are optional (#11135)
* useSingleRequestParameter should mark parameter optional if all properties are optional

* update samples
2021-12-24 16:46:02 +01:00
William Cheng
588cd15323 fix openapi-generator-cli version 2021-12-22 00:42:28 +08:00
William Cheng
8d16239aab Merge remote-tracking branch 'origin/5.4.x' 2021-12-21 22:04:47 +08:00
William Cheng
6269a9810c
Prepare 5.3.1 release (#11161)
* prepare v5.3.1 release

* update samples
2021-12-21 18:20:13 +08:00
William Cheng
e3788ce44e update doc for okhttp-gson-nextgen 2021-12-21 15:48:47 +08:00
Bruno Coelho
c305c71715
[DefaultCodegen] generate unknown default case (#11078)
* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] replace Swift custom implementation with the DefaultCodegen implementation

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] update docs

* [DefaultCodegen] fix Swift enum case name

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case
2021-12-21 15:40:13 +08:00
alisters
0de482da2b
Kotlin client: add volley library support (#10253)
* Add basic jvm-volley folder to enable it as a library

* Add JVM_VOLLEY to the KotlinClientCodegen as a library option (using Retrofit2 processing for now)

* Temporary checkin of generated code and kotlinfied version for use in new template

* Added Kotlin-ified api invoker and request objects, update Kotlin client codgen for volley

* Add Android specific build.gradle mustache file to jvm-volley library

* Hardcode SDK version and build tools version in build.gradle template, add extra repository for Android Gradle build tools

* Add Android manifest to generated code

* Add Kotlin dependencies and plugins to build gradle template

* WIP: Create basic API templating for jvm-volley

* Add ApiException and parameter validation, create path variable using ApiInvoker

* Build queryParams and headerParams

* Add VolleyRequest template

* WIP: Injecting context and default API invoker into APIs (non compiling)

* Add DefaultInvoker stub and update API to inject context

* Add request queue generation to the DefaultInvoker

* Fix up compile errors in the invoker

* Cleanup unrequired templates

* Update templates

* Add constructor overloads to inject stack or network into request queue

* Fix compile errors with request queue generation

* Fix compile errors

* Al'll fix it for you.....

* WIP compile fixes

* More compile fixes

* Generate to java directory and kotlin-ify auth code

* More syntax fixes in templates

* Almost left it in a working state, fixing that .... now...

* Switch builder method based on model existence constraints - body and response

* Add coroutine logic to APIs and pass through listeners to the requests, various other fixes.

* Use reflection and type tokens to work around clazz issues on generics

* Add POST, PATCH and PUT to RequestFactory

* More templating magic

* Fix Steve, the human compiler's errors again !

* Add CLI option for generating room models

* Configure the room model package

* Add initial room model templating and generation

* Add room model generation implementation

* Implement toRoom function on models to convert model to room model

* Bug fixes, transformers to and from room models

* Add query parameters to URL generation

* Fix issues with gson type conversion, add type adapters to gson instance

* Fix issues with older API versions and Java8 libraries,

* Add request factory interface

* API template tidy up

* Update IRequestFactory to include companion object, minor tidy ups

* Remove @Keep annotations from room templates

* Rename toRoomModel and toApiModel functions

* Add empty companion object to generated room model

* Add ITransformStorage interface to allow polymorphic transforms to room models

* Add content type into GsonRequest

* Move gson serialization of request body into GsonRequest

* Update request factory to take header factories

* Remove the generated comparision code

* Move the generateRoomModels switch into the KotlinClientCodegen class

* Move room model generation out of default generator

* Updates for auth

* Finalise removal of kotlin elements from default generator

* Hoist room model logic out of abstractKotlin into kotlin client codegen

* Revert AbstractKotlinCodegen

* Revert Codegen constants to remove base generator changes out of our new library

* Revert data class template changes, add data class body check to Kotlin Client codegen

* Add sample generation yaml file for jvm-volley library

* Update JVM-Volley readme for generateRoomModels flag

* Remove unused template files, get auth compiling but non functional, clean build of warnings

* Generate sample generated code

* Add not implemented method for oauth

* Add unit test for KotlinClientCodegen generateRoomModel flag

* Remove accidental hard coding of src/main/java source folder

* Push changed generated sample files

* Move and rename IStorable inside the volley library

* Inject retry policy into API definition, re-run sample and doc scripts

* Add generic post processors

* Update samples after generator changes

* Fix some compile errors with the pet store sample

* Fix duplicate auth companion object and import generation

* Reinstate query and form parameter code generation

* Add check for unsupported serialization libraries

* Fix broken unit tests

* Regenerate samples

* AN-233 Update request factory to allow custom gsonadapters

* update `GsonRequest.mustache` and `RequestFactoy.mustache` to use `Map<Type, Any>` instead of `Map<Type, Object>` to better fit kotlin conventions

* Update readme with better examples and design notes

* Update readme with info about gson serializers and adapters for polymorphic types

* Updated samples

* Merge from upstream

* Address review comments

* Update samples

* Samples

* Update docs

* Remove DateAdapter generated file, template and it's inclusion as a supporting file in favour of localDateTime

* Review comment cleanup for initial PR #10253 - cleaner auth key in parameter string handling

* Review comment - add a kotlin version parameter to the build scripts

* Updated samples

* Missing changes from build.mustache

* Regenerate samples for build.gradle changes

* Merge from master and generate samples

* Remove serializer as a supporting file from jvm-volley - it's serialisation is not a singleton and configured differently via gson request and dependency injection

* Remove singleton serializer from jvm-volley generation as it's not used

Co-authored-by: Alister Shipman <alister.shipman@greater.com.au>
Co-authored-by: Steve Telford <steven.telford@greater.com.au>
Co-authored-by: Leigh Cooper <leigh.cooper@greater.com.au>
Co-authored-by: Michael Hewett <y2trooper@gmail.com>
2021-12-20 14:59:11 +08:00
William Cheng
b72eba90cd
[java][okhttp-gson-nextgen] better oneOf implementation (#11146)
* add validJsonObject method

* add check for null

* fix list model generation

* fix optional fields validation

* add tests

* fix variable naming

* update tests

* add fromJson in oneOf, add tests

* convert JSON to static

* remove trailing space

* add fromString methods to all models

* add toJson, fix anyOf template

* remove workarounds

* undo changes to tests

* skip file schema test

* add new file
2021-12-18 23:22:55 +08:00
Yuriy Belenko
d65bf8d1a6
[php-slim4] Partial generation (#11069)
* Update tests folder

I forgot to update tests folder in latest PR. Fixing my mistake.

* Implement part generation
2021-12-17 16:11:06 +08:00
Yuriy Belenko
7dbcac3b6c
[php-slim4] Switch to Packaged Body Parsing Middleware (#9562)
* Remove custom JSON parsing middleware

* Enable packaged Body Parsing Middleware

Ref:
https://www.slimframework.com/docs/v4/middleware/body-parsing.html

* Refresh samples
2021-12-17 15:24:21 +08:00
Hui Yu
490377c7b0
[C][Client] Support custom data type e.g.IntOrString (#11074) 2021-12-17 13:01:37 +08:00
Michael Brügmann
1e3dd1f7c8
[Swift5] replace special characters in Swift enum var name (#11131)
* replace replaceSpecialCharacters in enum var names

* test special characters in enum var names

* ./bin/utils/export_docs_generators.sh

* bring back replacement check for whole string

* Revert "./bin/utils/export_docs_generators.sh"

This reverts commit 63dfd33dd309739831d4f833f29817b28bdb45fe.

Co-authored-by: Michael Brügmann <mail@michael-bruegmann.de>
2021-12-17 12:14:20 +08:00
Tal Kirshboim
acadba4bfb
Declare Kotlin API classes as open (#11129) 2021-12-17 12:12:47 +08:00
Josh Burton
6f6d4f8c02
[dart-dio-next] Removes dioLibrary option (#10931)
As there is no longer a fork of the dio library this option can be removed
2021-12-17 10:36:42 +08:00
Samuel Nelson
80d1eedc20
Fix deprecation issue since akka-http 2.6 (#11048) 2021-12-17 10:20:26 +08:00
Bruno Coelho
42d635b463
[swift5][client] improve code formatting (#11124)
* [swift][client] improve code formatting with multiple response as

* [kotlin][vertx] update sample project
2021-12-17 10:19:41 +08:00
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
Tomáš Čermák
9b65513bb1
[Protobuf-Schema] Namespace updates (#11115)
* [Protobuf-Schema] Namespace updates

* [Protobuf-Schema] Petstore sample updated
2021-12-17 10:12:11 +08:00
agilob
ebb69147a5
Forbid using standard streams in archunit (#11130) 2021-12-17 10:11:36 +08:00
William Cheng
c27ddc67fe
show error when schema in discriminator mapping is undefined (#11127) 2021-12-15 22:18:39 +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
Tomáš Čermák
d5979d3180
[Protobuf-Schema] Added nullable (#11073) 2021-12-14 15:44:22 +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
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
e00efe7c8d Merge remote-tracking branch 'origin/5.4.x' into 6.0.x 2021-12-07 00:12:13 +08:00
William Cheng
2b7910c875 Merge remote-tracking branch 'origin/master' into 5.4.x 2021-12-06 23:57:07 +08:00