1508 Commits

Author SHA1 Message Date
WILLIAM CHENG
42f4e863b7 prepare 5.4.0-SNAPSHOT 2021-10-25 12:13:33 +08:00
William Cheng
378465702c
Prepare v5.3.1 in the master (#10681)
* prepare v5.3.1

* update doc

* update readme
2021-10-25 01:16:07 +08:00
William Cheng
2413783288
update build.gradle to work with gradle 7.x, add test (#10669) 2021-10-24 12:19:52 +08:00
William Cheng
ec2ed98269
better comment/docstrings in jersey2 apiclient (#10668) 2021-10-24 12:19:20 +08:00
William Cheng
bb37a71d06
update dependencies in build.sbt to newer versions (#10667) 2021-10-23 16:17:46 +08:00
Maciej Sitarz
2875c7e14d
Improve Apache Httpclient support (#10624)
* Move apache-httpclient templates to proper dir

* Add template for Gradle

* Fix few JavaDoc compile warnings

* Add properly generated samples

* Empty just trigger PR checks rebuild
2021-10-23 14:57:32 +08:00
WILLIAM CHENG
afacdb229a Merge remote-tracking branch 'origin/master' into 6.0.x 2021-10-23 10:16:27 +08:00
William Cheng
7b7d7db0c7
[Java][okhttp] rename enum (#10642)
* rename java enum with uppercase

* add tests for snake case lambda

* update file header

* update feign templates with new enum names

* update okhttp template wth lambda

* fix tests
2021-10-23 10:15:30 +08:00
William Cheng
885a813f86
update java jersey2 dependencies (#10659) 2021-10-23 10:13:39 +08:00
William Cheng
681578d1b5
rename enum constants (#10631) 2021-10-22 09:26:48 +08:00
William Cheng
730636ad31 Merge remote-tracking branch 'origin' into 6.0.x 2021-10-19 12:55:59 +08:00
Hugo Alves
ff286aa06f
[Java][Feign] Add http status to feign result (#10583)
* Add .circleci/config.yml

* Add Http status to the feign response wrapper

* Add Http status to the feign response wrapper

* Add Http status to the feign response wrapper

Fix typo

* Add Http status to the feign response wrapper

Fix typo

* Rename HttpResponse to ApiResponse
2021-10-19 00:04:32 +08:00
William Cheng
2bd2c23115
Revert "[JAVA][jersey2] import the auto generated supporting JSON class only when discriminator is needed (#10557)" (#10597)
This reverts commit 52713b21d452bcc4219793861443b495d2a03213.
2021-10-14 11:41:19 +08:00
beytun
52713b21d4
[JAVA][jersey2] import the auto generated supporting JSON class only when discriminator is needed (#10557)
* Import the auto generated supporting JSON class only when discriminator is needed

* Generate samples again
2021-10-12 16:05:38 +08:00
William Cheng
4b62b55877
use implementation, add min version of maven, gradle (#10571) 2021-10-11 21:10:04 +08:00
Hugo Alves
331b61dc1c
[Java][Feign] Expose response headers for feign client (#10507)
* Add .circleci/config.yml

* Add the property exposeResponseHeaders to feign client

This new property indicates if the feign client should expose the response headers on the API class.

* Generate new docs for exposeResponseHeaders additional property

* Rename HeaderAwareResponse to HttpResponse

* Update samples

* Refactor the implementation to use the same approach as the c# generator.
Creates a new feign operation with the suffix WithHttpInfo, this operation returns the response encapsulated in a HttpResponse class.
The HttpResponse class contains the decoded body and the response headers

* Refactor the implementation to use the same approach as the c# generator.
Generate samples

* Refactor the implementation to use the same approach as the c# generator.
Generate docs

* Use Void instead of void for HttpResponse parameterized type
2021-10-09 15:50:55 +08:00
William Cheng
96c65fea61
[Java] add an option to customize gradle.properties (#10540)
* add an option to customize gradle properties

* add more info to gradle.properties
2021-10-08 11:20:50 +08:00
William Cheng
6c5f6d2400
[java] Update Gradle to 7.2 (#10538)
* update gradle to 7.2

* update samples

* use gradle-7.2-bin.zip instead
2021-10-08 10:48:27 +08:00
William Cheng
0bfa28f844 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-10-06 12:00:02 +08:00
RomainPruvostMHH
1735ab9d27
[Java] Replace Java EE 8 dependencies by Jakarta EE 8 (#10513)
* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5

* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5 for sbt

* Migrate javax.annotation:javax.annotation-api to
jakarta.annotation:jakarta.annotation-api:1.3.5 for gradle

* Commit samples files after the execution of the command
"generate-samples.sh for configs java and kotlin

* Delete org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec
from the exclusion section of org.jboss.resteasy:resteasy-client in the
resteasy module because jboss-annotations-api_1.2_spec isn't a
transitive dependency

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for maven

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for gradle

* Migrate javax.validation:validation-api to
jakarta.validation:jakarta.validation-api:2.0.2 for sbt

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.ws.rs:javax.ws.rs-api to
jakarta.ws.rs:jakarta.ws.rs-api:2.1.6 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.json.bind:javax.json.bind-api to
jakarta.json.bind:jakarta.json.bind-api:1.0.2 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.json:javax.json-api to jakarta.json:jakarta.json-api:1.1.6
for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.xml.bind:jaxb-api to
jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 for maven

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.el:el-api to jakarta.el:jakarta.el-api:3.0.3 for maven

* Migrate javax.servlet:servlet-api to
jakarta.servlet:jakarta.servlet-api:4.0.4 for maven

* Delete the property servlet-api-version in pom files because it is
useless

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Migrate javax.activation:activation to
jakarta.activation:jakarta.activation-api:1.2.2 for maven

* Delete javax.activation:activation from the exclusion section of
org.jboss.resteasy:resteasy-client in the resteasy module because
javax.activation:activation isn't a transitive dependency

* Commit samples files after the execution of the command
"generate-samples.sh for configs java, spring, jaxrs and kotlin

* Fix the name of property jakarta.activation-version

* Fix a missing property 'jakarta-annotation-version' in
JavaJaxRS/resteasy/pom.mustache

* generate samples

* Fix version value of jakarta.validation-api artifact in
Java/libraries/rest-assured/pom.mustache

* Fix missing property jakarta-annotation-version in
jaxrs-resteasy/eap/pom.mustache

* generate samples

* Revert changes in sample files after running the command
generate-samples.sh in gitBash

* Fix files in
samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8

* Replace the old dependency javax.validation:validation-api by the new
Jakarta EE 8 jakarta.validation:jakarta.validation-api in
openapi-generator-online

Co-authored-by: rpruvost <rpruvost@ITEM-S78402.emea.msad.sopra>
Co-authored-by: rpruvost <romain.pruvost@soprasteria.com>
2021-10-05 09:47:29 +08:00
Justin Black
d4b8ff60a1
[Java] Fixes schema class type booleans for composed schemas (#10334)
* Adds get/setIsString interface to IJsonSchemaValidationProperties

* Adds get/set isNumber interface in IJsonSchemaValidationProperties

* Adds get/set isAnyType in IJsonSchemaValidationProperties

* Adds and uses ModelUtils.isAnyType, adds setTypeProperties

* Adds missing descriptions of isAnyType parameters

* Uses ModelUtils.isAnyType

* Samples regenerated

* Moves isArray handling higher up in fromProperty

* Moves isAnyTypeSchema handling higher up in fromProperty

* Moves isFreeFormObject handling higher up in fromProperty

* Refactors fromProperties, updates tests

* Fixes the fromProperty refactor, tests now pass

* Uses setTypeProperties to set isNumber, isNull, isArray, and isUnboundedInteger

* Sets isAnyType in setTypeProperties

* Sets isMap in setTypeProperties

* Sets property.isPrimitiveType in isFreeFormObject, tweaks if condition order

* Adds fix for JavaClientCodegenTest.testJdkHttpClientWithAndWithoutDiscriminator

* Refactors fromProperty

* Adds updatePropertyForObject updatePropertyForAnyType

* Sets binary and file types to not be strings

* Updates samples

* Adds updatePropertyForString

* Adds testComposedPropertyTypes

* Fixes python test

* Samples updated

* Switches all isAnyTypeSchema usages to ModelUtils.isAnyType

* Refactors model enum handling higher up

* Moves m.dataType assignent higher into fromModel

* Moves m.isNullable setting higher into isModel

* Adds updateModelForComposedSchema

* Further fromModel refactoring, all schema checks are now at the same indentation level

* Further refactors fromModel, adds isTypeObjectSchema block

* Moves addVars into anyType or objectType blocks in fromModel

* Turns off isNullable n isAnyType array

* Fixes typescript CodegenParameers

* Adds updatePropertyForAnyType to typescript-axios so property.isNullable will be false for AnyType

* Adds testComposedModelTypes

* Updates ComposedAnyType schema

* Fixes tests for JavaJAXRSCXF by adding updateModelForObject method

* Updates go and csharp to handle object model differently

* Adds updateModelForAnyType

* Fixes name reference

* Adds testComposedResponseTypes

* Refactoring fromResponse

* Further refactoring of fromResponse

* Uses setTypeProperties in fromResponse

* Tests now pass for testComposedResponseTypes

* Sets COdegenResponse dataType using getTypeDeclaration

* Begins refactoring of fromRequestBody

* Adds updateResponseBodyForPrimitiveType

* Adds all needed type if else blocks in fromRequestBody

* Fixes JavaJAXRSCXFExtServerCodegenTests

* Fixes RubyClientCodegenTests

* Adds fixes for clients that need custom isMap for body parameters

* Ruby broken, samples regened, debugging

* Adds updateRequestBodyForArray, renames updateRequest.. methods

* Samples regenerated

* Removes changes from Ruby generator

* Reverts RubyClientCodegen.java

* Reverts changes to GoClientCodegen.java

* Reverts PowerShellClientCodegen.java

* Reverts CrystalClientCodegen.java

* Removes updateRequestBodyForObject from JavaCXFServerCodegen.java

* Adds comment about refed models

* Tweaks made to fromProperties to add an explanatory comment

* Updates RustServer to have ByteArray request bodies not be strings

* Sets types in fromFormProperty

* Adds testComposedRequestBodyTypes

* Fixes when validation syncing is done in syncValidationProperties

* Removes redundant validation code from fromParameter

* Moves parameter inX setting higher up before schema logic in fromParameter

* More refactoring in fromParameter, uses early return to reduce levels of indentation

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForArray

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForObject

* Removes setParameterBooleanFlagWithCodegenProperty from  updateRequestBodyForPrimitiveType

* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForMap

* Removes setParameterBooleanFlagWithCodegenProperty from addBodyModelSchema

* Removes setParameterBooleanFlagWithCodegenProperty from fromFormProperty

* Refactors parameter array handling code into fromFormProperty

* Simplifies fromRequestBodyToFormParameters

* Removes setParameterBooleanFlagWithCodegenProperty from fromParameter

* Adds deprecated docstring to setParameterBooleanFlagWithCodegenProperty

* Refactors ModelUtils.isFileSchema out of string schema check

* Removes ModelUtils.isFileSchema from RustServer updateRequestBodyForString

* Improves comment text

* Fixes RustServer uuid type setting for CodegenParameter

* Removes unneeded parens

* Fixes array property examples

* Removes unused code

* Renames variable to itemsProperty

* Adds testComposedRequestQueryParamTypes

* Adds updatePropertyForAnyType to rustserver will not have changed model properties

* Hoists arrayInnerProperty._enum into parameter for html2 generator

* Moves turning string type off into the codegen files

* Adds two more missing locations in rustserver

* Moves addVarsRequiredVarsAdditionalProps into anytype and objecttype handling

* More refactoring of where addVarsRequiredVarsAdditionalProps is used

* Samples regenerated
2021-09-27 16:12:40 -07:00
William Cheng
150e304b4c update samples 2021-09-25 13:56:00 +08:00
William Cheng
acd747ca6d Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-22 12:13:44 +08:00
RomainPruvostMHH
04e67acd0a
Fix issue 8352: [Java][RestTemplate][WebClient] Incorrect handling of free form query parameters (#10428)
* [Java][RestTemplate][WebClient] fix issue #8352 handling of free-form
query parameters with Java

* replace tab by spaces

* commit samples files generated by the generate-samples.sh script
2021-09-21 11:40:56 +08:00
Thomas Leplus
80fb9e9889
Use 'this' to assign to class field. (#10417) 2021-09-19 11:42:34 +08:00
William Cheng
477e2365c7
improve git_push.sh (#10356) 2021-09-09 12:49:03 +08:00
William Cheng
1231b1ab04 update samples, update html doc 2021-09-09 12:09:38 +08:00
Peter Leibiger
a558554961
Add OAS3 allowEmptyValue for query params (#10312)
* add the special case of empty query parameters to the fake API
2021-09-03 16:32:51 +08:00
Kaijia Feng
8cc2bc4fa7
[Java][RestTemplate][WebClient] Fix typo in comments (#10311) 2021-09-02 21:03:29 +08:00
Artem
d68d65ce00
Fix java examples (#10257)
* TAP-655 fix examples java

* update samples
2021-09-02 11:08:35 +08:00
Oleh Kurpiak
c148539ce3
[Java][Spring] fix imports for nullable helpers (#10234) 2021-09-02 11:01:12 +08:00
William Cheng
ff6ff6e81a update samples 2021-09-01 14:25:22 +08:00
William Cheng
0357b80f19 Merge remote-tracking branch 'origin/master' into 6.0.x 2021-09-01 14:16:17 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
Thomas Zeeman
f2b50faeec
Fix unchecked conversion (#10246)
* Fix unchecked conversion

Update restttemplate and webclient templates to use <>-operator.
Also update samples.

* Update samples
2021-08-25 10:09:53 +08:00
Johannes Wienke
e89e19e43e
Add a Jandex index to microprofile client packages (#10173)
Quarkus, as one potential target for using the Java microprofile client
generator, requires a Jandex index to be present in library jars for
discovering beans inside these jars. Therefore, include Jandex index
generation in the pom.xml for microprofile clients as explained here:
https://quarkus.io/guides/cdi-reference#how-to-generate-a-jandex-index

Generating and shipping the index is only a small overhead that is
probably not worth an additional client option.
2021-08-22 11:57:28 +08:00
Hugo Alves
197cdac1e0
[JAVA][FEIGN] Automatically retry request that fail due to a 401 or 403 (#10021)
* Renew the access token after receiving a 401/403

Feign clients tries to renew the access token after it receives a 401 or 403. It Retries the request 1 time

* Add unit test for exhausted retries

* Update samples
2021-08-22 11:45:04 +08:00
William Cheng
3de5483aa0
[JAVA] Add apache httpclient library to java clients (#10218)
* Add apache java client option

* Add sample apache client config

* Switch serialization library, use time formatter

* Add pom template for apache dependencies

* Add initial implementation of ApiClient using apache

* Add apache api template

Plus switch to TypeReference to handle generic types

* Add support for sending json data

* Generate test stubs with @Ignore

* Add accept header

* Remove unnecessary builder assignments

* Set responseHeaders instance variable

* Switch to general serialize / deserialize functions

* Handle sending url encoded form data

* Split response processing into new method

* Allow requests without body

* Use general HttpResponse interface

If the method doesn't need to close it

* Use clients connection timeout

* Add constructor accepting custom client

* Handle multipart and direct file uploads

* Support file downloading

Based on the implementation in the jersey client

* Handle missing content disposition

* Raise error if body given for an unexpected method

* Use try with resources for response handling

* Remove unused url parameter encode method

* Handle content type parse exception

* Improve response content type handling

Would have had issues with content type headers containing a charset

* Make all set methods return client

* Add basic readme

* Send content type with files

* Set domain and path on cookies

Otherwise they will be excluded from the request

* Use consistent quoting in error messages

* Add generated apache sample

* Add generated docs changes

* update samples

* rename library, update samples, docs

* update readme

Co-authored-by: Harry White <hwhite@atlassian.com>
2021-08-22 11:17:31 +08:00
Adrien Guerard
a7de7095a7
[Java][Native] Add an async response interceptor in ApiClient (#10027)
Prior to this change, clients generated with asyncNative=true
could not intercept the responses using the existing repsonse
interceptor. This adds another response interceptor solely for
asyncNative=true clients.
2021-08-18 21:11:29 +08:00
Johannes Wienke
c71e66835b
[Java] Add missing imports for Set in java clients (#10171)
* Add missing imports for Set in microprofile client

In case of array properties declared with uniqueItems: true, the
generated Java code uses Sets but imports are not present for them in
the Api and Test classes.

* Add missing imports for Set in java native clients

In case of array properties declared with uniqueItems: true, the
generated Java code uses Sets but imports are not present for them in
the Api and Test classes.
2021-08-18 15:48:12 +08:00
William Cheng
0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3ed f8ff8c87609
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c87609b1ca36fa26fb8474806999638195e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709d6a3f846a9fe4520b78c3d637051d9
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e2333f3ae19ef6fc89318b7e263a80c
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f48227d55531b94e307d72671373737
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722c34aa094b4aeb11c22664529c3a219
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e3594bf0d30e580bc9408e45b018a57
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +08:00
agilob
7edddb6531
Add map property in url params (#10154)
* Add map property in request params

* Regenerate samples to include map in url property
2021-08-17 18:31:53 +08:00
William Cheng
eaa76f8e1f Merge remote-tracking branch 'origin/master' into 6.0.x 2021-08-17 18:10:59 +08:00
William Cheng
764a462711 Merge remote-tracking branch 'origin/5.3.x' 2021-08-16 21:38:34 +08:00
William Cheng
8403e59aa0
Prepare 5.2.1 release (#10161)
* prepare for 5.2.1 release

* update samples
2021-08-16 19:08:29 +08:00
Nathan Baulch
dc23267580
[csharp] Obsolete attribute on deprecated operations and properties (#10084) 2021-08-04 17:28:45 +08:00
Gareth Smith
98e4eb708f
[BUG]Java] Fix a race condition in RetryingOAuth.mustache (#10087)
If there were multiple concurrent requests at a time at which the OAuth token had expired, only a single request would be retried. The other requests would fail because of the expired token, but not be retried and so the failures would be propagated to the caller.
2021-08-04 10:06:39 +08:00
William Cheng
4d0a40e982 update samples 2021-08-04 01:21:22 +08:00
Sem Schilder
4210b41f84
[php-symfony] Add backslash to "load" namespaces from global namespace (#9740)
* Add backslash to load namespace from global namespace

* Update example

* Remove hardcoded slash

* Add backslash from java side

* Update samples

* Fix first sample

* Fix other snapshot

* Update version file
2021-08-03 17:09:52 +08:00
William Cheng
c28c1253a4
fix missing jackson-databind-nullable in okhttp java client (#10078) 2021-08-03 17:07:14 +08:00