1508 Commits

Author SHA1 Message Date
Toby Murray
cbe1fd9728
Bump Gradle in generated Java projects to 6.7.1 (#8079)
* Bump Gradle in Java projects from 6.0.1 to 6.7.1

Regular maintenance, 6.0.1 was released November 18th, 2019 and the latest release (November 16th, 2020) is 6.7.1. This updates all the wrapper templatesto the latest version.

* Updated generated Java samples

Generated via `./bin/generate-samples.sh bin/configs/java-*`

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-12-07 10:44:23 +08:00
Thomas Hervé
616b44f3b1
Improve generated Java examples (#8012)
* Add basic types imports to generated examples

This adds an extension to include basic types imports to generated Java
examples.

* Make some fixes to example generation

* Generate OffsetDatetime correctly

* Create a useful sample for enums, regenerate samples

* Fix BigDecimal as well
2020-11-26 18:14:26 +08:00
David Ruppelt
4f0e75b32d
remove default ContentType for java webclient (#7945) 2020-11-24 22:28:23 +08:00
Thomas Hervé
14ff8e0ffd
Remove links to basic types in java API docs (#7989)
* Remove links to basic types in java API docs

This removes (most) wrong links to basic types in Java API docs.

* Regenerate some more samples
2020-11-23 16:24:31 +08:00
William Cheng
2578ef5e63
Prepare snapshot (v5.0.0) (#7986)
* Revert "prepare 5.0.0-beta3 release"

This reverts commit 3ebe774df37b43348bac1310a272de53a2d7040b.

* revert to snapshot

* update samples
2020-11-20 19:19:59 +08:00
William Cheng
2715f1371a
Prepare 5.0.0 beta3 (#7984)
* prepare 5.0.0-beta3 release

* update samples

* remove beta3 from readme
2020-11-20 15:18:58 +08:00
William Cheng
e09d1bee43
[Java][webclient] fix missing dependencies in build.gradle (#7777)
* fix build.gradle in java webclient

* update junit version in samples
2020-10-21 21:29:53 +08:00
William Cheng
d6c71ff0fb
[java][jersey2] add proxy support (#7752)
* add client config getter and setter

* update gradle, sbt config

* update client config

* update samples

* add code sample to set proxy
2020-10-20 10:11:01 +08:00
Justin Black
2ee0913d4a
Changes lingering isMapContainer to isMap (#7747)
* Changes lingering isMapContainer to isMap

* Adds ensure up to date updates
2020-10-18 20:07:33 -07:00
bgong-mdsol
edf153eede
[Java][Native] Support oneOf/anyOf schemas (#7263)
* Java-native add models of oneOf/anyOf

* Java-native refresh samples

* Java-native add a sample project for openapi3
2020-10-15 17:29:51 +08:00
William Cheng
b768e42704
Update junit to newer version (4.13.1) (#7690)
* update junit to newer version

* update junit to newer version
2020-10-14 10:10:32 +08:00
William Cheng
fe31b9e2ce
java jersey2: remove trailing whitespaces (#7632) 2020-10-09 17:11:23 +08:00
William Cheng
3d36d491df
replace tab with spaces (#7625) 2020-10-08 23:00:36 +08:00
William Cheng
4bf81a0263
update microprofile default license info file (#7550) 2020-09-30 16:46:24 +08:00
Philipp Paris
c7d5275b62
[java] jaxrs (all) add usetags option (#6130)
* Adds "useTags" option to all jaxrs code generators (AbstractJAXRSServerCodegen):
  - jaxrs-jersey
  - jaxrs-spec
  - jaxrs-cxf-cdi
  - jaxrs-resteasy
  - jaxrs-cxf
  - jaxrs-cxf-extended
  - java-msf4j
  - jaxrs-resteasy-eap
* jaxrs-spec
  - Changed handling of root paths: e.g "/:", "/{id}:" to simplify code and create a more consistent behaviour
    -- old: use tag for classname
    -- new: use tag only if useTags is enabled, use "DefaultApi" if not
* @path class level annotation
  - for all generators above and the microprofile generator (uses same jaxrs postprocessing)
  - extended the "commonPath" to contain more than only the root path if possible
  - e.g. "/group1/subgroup1/op1" -> "/group1/subgroup1" is moved to class level annotation
2020-09-20 21:18:07 -04:00
dtiller
3f7a3f2b59
[TYPO] [WEBCLIENT] Issue 7425: Fixed comments that referred to RestTemplate. (#7445)
* Issue 7425: Fixed comments that referred to RestTemplate.

* Ran genreate-samples.sh

* Re-ran generate-samples.sh against all configs.

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-09-19 12:07:35 +08:00
William Cheng
2fd23f505e
Prepare 5.0.0-SNAPSHOT (#7347)
* Revert "Prepare 5.0.0-beta2 release (#7345)"

This reverts commit 212b4f784742744b7b238607dcefb23ec9db64d7.

* update readme
2020-09-04 15:31:54 +08:00
William Cheng
212b4f7847
Prepare 5.0.0-beta2 release (#7345)
* update version

* update doc

* update samples
2020-09-04 13:03:45 +08:00
Jim Schubert
a6d30cac9d
[core] Templating: limit compilation to supported extensions and constrain target paths (#6598) 2020-09-02 15:52:35 -04:00
William Cheng
19c5ed783a update samples 2020-08-31 23:17:55 +08:00
Oleh Kurpiak
14a500c6fe
[Java][Client] Use java8 OffsetDateTime for clients (#7190)
* use java8 OffsetDateTime for clients

* use java8 OffsetDateTime for clients

* fix javadoc

* add javadoc to JavaTimeFormatter.mustache

* add javadoc to JavaTimeFormatter.mustache

* add javadoc to JavaTimeFormatter.mustache
2020-08-31 22:31:28 +08:00
Patouche
b9662dc25d
[java] Intro openApiNullable property to enable/disable OpenAPI Jackson Nullable library (#6154)
* Add option to prevent usage of jackson-nullable (#2901)

Add a option for all java client and server to prevent
usage of third party library (jackson-databind-nullable)
which may be forbidden in some company

Add samples for Vertx, Spring MVC, Spring Cloud, Feign and Play

Upgrade dependencies for org.openapitools:jackson-databind-nullable

* Samples - Remove dependency org.openapitools:jackson-databind-nullable (#2901)

* Fix generation of gradle file for vertx (#2901)

* Regenerate samples (#2901)

* Fix documentation and up to date (#2901)

* Fix forgotten regeneration of vertx after dependency integration (#2901)

* Regenerate template after rebase (#2901)

* Use yaml config files introduce in #6509 to manage samples (#2901)

* Regenerate template using the config (#2901)

* Fix bad version during testing generated samples (#2901)

* Regenerate template after fix bad version (#2901)

* Fix merge, allow for set importing on codegen model

Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-08-31 21:25:18 +08:00
William Cheng
26c17c5774
[Java] remove deprecated jackson classes (#7304)
* [java/resttemplate] Generate valid code if no Authentication implementations present

Take the logic used to decide which instances to add to the authentications map and re-use to not import classes or offer non-functional util methods

* parameterize formParams

fixes #5782

* replace use of ISO8601DateFormat and ISO8601Utils with StdDateFormat

fixes #5779

* add constructor to intialise calendar

* Revert "[java/resttemplate] Generate valid code if no Authentication implementations present"

This reverts commit 6e450907bae1d831a4a8c9b66f6b707424f0a39a.

* Revert "parameterize formParams"

This reverts commit 7a26ce5dd21ce147ed33728cd0091a29175367a4.

* also override single arg parse method to avoid throwing exception

* also override single arg parse method to avoid throwing exception

* update samples

* update samples

* fix jersey1 tests

* fix jersey2 test

* update resteasy dependencies

* fix java jersey2 oas3 tests

* use java8 in springboot-beanvalidation

Co-authored-by: Jon Freedman <jon.freedman@zoho.com>
2020-08-27 23:13:56 +08:00
Niels Pardon
d868fd6dc8
[Java][clients] remove java.lang prefix from Object (#6806) 2020-08-24 22:06:19 -04:00
TIm Clark
cbdedff0ad
[Java][jersey2] Add jersey injection dependencies (#7240)
* Adds the jersey injection dependency to gradle and sbt to match
the maven dependency.
* Update jersey version in sbt
2020-08-21 16:51:11 +08:00
Jon Freedman
9ba34b2805
[Java] parameterize formParams (#5784)
* parameterize formParams

fixes #5782

* sync generated code

* update to latest version of spring, replace MultiValueMap#put with #addAll, remove unused imports

* restore java.util.HashMap import

* update spring version in pom/gradle templates

* re-generate resttemplate samples

* fix test

* fix test

* parameterize an additional usage of LinkedMultiValueMap

* re-generate resttemplate samples

* re-generate webclient samples

* manually edit FILES to replace \ with /
2020-08-12 15:55:53 +08:00
beytun
a1484dac77
[Java] Update templates not to add @Pattern on byte array property (#7153)
* Update Java templates to skip generating @Pattern on byte array properties

* Revert separator changes

* Revert separator changes
2020-08-12 14:29:50 +08:00
Dmitry Mavrichev
0cb4c43c42
[BUG][JAVA] Fix error handling in okhttp-gson async api client (#7089)
* Fix error handling in okhttp-gson async api client

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-04 11:44:18 +08:00
mikesaurus
34f0d02f38
ISSUE-4222: Prevent conflicts with accept(s) local variables in generated Java RestTemplate ApiClient (#7101)
* ISSUE-4222: Change accept(s) to localVarAccept(s) in Java/resttemplate/api.mustache

* ISSUE-4222: Regenerate samples
2020-08-04 09:52:16 +08:00
Yuriy Belenko
6a08ec59c0
[core] Add type and format properties to model of inline response (#6153) 2020-08-03 18:37:37 -04:00
William Cheng
a9576a1e2b
fix http signaure auth in build.sbt (#7110) 2020-08-03 10:10:47 +08:00
TIm Clark
800d9453a4
[Java][jersey2]Fix gradle HttpSignatureAuth dependencies (#7096)
* Corrects tag for including HttpSignatureAuth in gradle builds
* Updates version of org.tomitribe:tomitribe-http-signatures in
gradle template to match version from maven template
* Updates samples
2020-08-02 16:18:44 +08:00
Benjamin Seiller
1cb34be8fe
[Java][okhttp-gson] prevent UnsupportedOperationException by removal from ImmutableList on setDebugging(false) (#7024)
* fix https://github.com/OpenAPITools/openapi-generator/issues/6934

* fix https://github.com/OpenAPITools/openapi-generator/issues/6934

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-07-28 10:22:46 +08:00
Ravisankar-Challa
276a983fe8
Add property additionalModelTypeAnnotations on the top of pojo class (#6037) 2020-07-24 12:08:30 +08:00
Slavek Kabrda
03e8aee8ea
[java][jersey2-client] Disable coercion of scalars (#6811)
* [java][jersey2-client] Disable coercion of scalars

* Respect the coercion objectmapper setting in deserializers

* Update jackson in maven plugin to get version that has ALLOW_COERCION_OF_SCALARS
2020-07-23 16:33:15 +08:00
William Cheng
9899315aab
[Java][jersey2] Fix serializeToString (#6956)
* fix empty get body in serializeToString, add tests

* add new file

* fix serialize to better handle null string

* update test comments
2020-07-23 10:39:04 +08:00
William Cheng
e9c231b50a
rollback feign version to 10.11 (#7012) 2020-07-22 21:21:11 +08:00
William Cheng
2ab35e0386
add JsonTypeName (#6995) 2020-07-21 14:21:10 +08:00
William Cheng
44d3f717f8 update java samples 2020-07-18 22:02:16 +08:00
Sebastien Rosset
968f32b55e
[Java][Jersey2] Add JsonTypeName annotation (#6551)
* Mustache template should use invokerPackage tag to generate import

* add JsonSubTypes annotation to handle scenario when OAS name has special characters

* add JsonSubTypes annotation to handle scenario when OAS name has special characters. Add unit test

* run sample scripts

* fix unit test

* run sample scripts

* add minimal openapi document to show issue with special characters and discriminators

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add 'isClassnameSanitized' tag

* Add unit tests for unmarshaling of discriminators with special characters

* Add unit tests for unmarshaling of discriminators with special characters

* use JsonTypeName

Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-07-18 21:56:41 +08:00
bgong-mdsol
8cd52033e4
[Java][Native] added WithHttpInfo method for async-native (#6903)
* [java-asyncNative] add withHttpInfo

* update api template for async-native
2020-07-17 15:30:02 +08:00
William Cheng
cef1bec466
fix null payload in java jersey2 (#6933) 2020-07-15 00:50:37 +08:00
Sebastien Rosset
b86a51ae17
fix typo (#6928) 2020-07-14 14:03:04 +08:00
William Cheng
5980c420e3
minor fix to sample code (java jersey2) (#6921) 2020-07-14 12:36:05 +08:00
jekkel
0be0a06d84
[Java][Client][vert.x] Support per-call authentication and JsonNullable in client request bodies, fix path parameter encoding (#5732)
* Support per-call authentication and JsonNullable in client request bodies

Extensions
----------
Since vertx is an asynchronous/reactive toolkit usage of mutable fields
of `ApiClient` to store authentication prohibits delegation of
authentication from incoming call without recreating the client
everytime (which is prohibitively expensive due to instantiation of objectmapper).
This commit adds a per call authentication override which takes precedence
over the mutable fields so a single client can be safely reused. To ease
usage a simple builder-style auxiliary `AuthInfo` object is provided
providing methods for each specified authentication.

A new configuration option for `ApiClient` has been added: `timeout`. It gets
applied as timeout for the vertx http request.

Fixes
-----
Request bodies have been wrongly serialized using vert.x built-in
objectmapper instead of the embedded instance thus usage of beans with
`JsonNullable` wrapped fields in request bodies led to bad requests.

* update vertx samples

* Client Java Vertx: Add url encode for path parameters.

* update vertx samples
2020-07-08 16:30:31 +08:00
Jorge Rodríguez Martín
068ad02bc8
[BUG] [JAVA] Fix multiple files upload (#4803) (#6808)
* gh-4803: Fix bug java client multiple files upload

* gh-4803: Fix bug java client multiple files upload

* gh-4803: Fix bug java client multiple files upload

* gh-4803: Fix bug java client multiple files upload

* gh-4803: Fix bug java client multiple files upload
2020-07-03 00:23:17 +08:00
grzegorz-moto
23f57a7290
[Java][WebClient]remove the dead code from java ApiClient.mustache (#6556)
* remove the dead code

Remove the dead code from ApiClient
The code is not used and it contains vulnerability of Log Forgery when it writes unvalidated http header to the log. An attacker could take advantage of this behaviour to forge log entries or inject malicious content into the log.

* update Petstore samples

* whitespace
2020-07-02 18:34:28 +08:00
tgerth
38ab7383f2
Make ApiClient in retrofit2 be able to use own OkHttpClient (#6699)
* set adapterBuilder.client() only if okBuilder was used in retrofit2

* updated the samples

* added field okHttpClient and updated samples

* bug fixed, added exception if okBuilder is null

* added semicolon

* added space, changed Exception to RuntimeException and changed its message

* updated the samples
2020-07-02 15:37:57 +08:00
William Cheng
520f87abae update samples 2020-07-02 12:00:27 +08:00
William Cheng
fa97333a5c
[Java] Deprecate feignVersion option (#6824)
* deprecate feign option

* update doc

* udpate samples
2020-07-02 00:12:32 +08:00