147 Commits

Author SHA1 Message Date
Philzen
2b9949a66b
Bump Jackson to latest v2.17.1 and sync in templates (#18799)
* Drop separate version property

Not required as all Jackson packages usually tether on a version bump.

* Update Jackson to v2.17.1

* Sync Jackson version used by Spring Boot with project version

* Sync jackson update to v2.17.1 with generator templates

* Regenerate samples with updated versions

* Adjust test to current exception msg behavior

* Add dependency mgmt to ensure matching version for transitive dependencies

* Update library descriptions with correct Jackson version number

* Update library descriptions with correct GSON and JSONB versions

* Update retrofit library description with correct version number

* Update retrofit description to include Jackson as an option

This should have been done as part of in #16853.

* Update remaining libary version descriptions with correct versions

* Generate updated doc
2024-06-02 15:17:38 +08:00
Marcel Huber
74a9509e0c
[Java][native] Fix: DateTime in deepObjects is no longer serialized correctly [fix #18742] (#18743)
* fix serialization of OffsetDateTime

* update samples

* wrap import
2024-05-27 16:32:32 +08:00
Marcel Huber
728abafdfa
[Java][native] Fix: empty deepObject can produce invalid query [fix #18736] (#18737)
* fix empty query parameter string

* update samples
2024-05-26 15:54:58 +08:00
aaronforest-wf
235b57e499
convert all text/* content types to strings in the apache http java client (#18731) 2024-05-23 16:36:34 +08:00
Horace Li
d0a8726580
[java][resttemplate] Fix missing javax validation imports with list validation (#18332)
* Fix java list validation

* Fix java list validation

* Fix java list validation

* Fix java list validation
2024-05-22 15:07:42 +08:00
William Cheng
741bf0c035
Prepare 7.7.0-SNAPSHOT (#18709)
* Revert "7.6.0 release"

This reverts commit d76f9d32d11a03be2b40ebff728ef0ff86332fcb.

* prepare 7.7.0 snapshot in master

* update samples
2024-05-20 17:27:17 +08:00
William Cheng
09be19cef7
upgrade okhttp-gson and google-api-client to junit5 (#18668)
* upgrade okhttp-gson and google-api-client to junit5

* add changes in StringUtilTest

* use https instead of http to fix 301 (moved) error

* revert petstore test server url to http://petstore.swagger.io and regenerate samples

* synced gradle/sbt/pom, re-generated samples

* revert removal of port 80 from test url

* udpate google api client tests

* update sha

* update comment

---------

Co-authored-by: Thorsten Hirsch <t.hirsch@web.de>
2024-05-14 17:04:33 +08:00
Jochem Kuijpers
2f9b487779
Fixes incorrect Jackson imports in Java templates used in ApiClient.java when useJakartaEe=true (#18507)
* Adds useJakartaEe condition to select the appropriate Jackson package to import.

This also removes the import on the apache-httpclient template where it doesn't actually get used, requiring users to declare additional dependencies for compilation that aren't actually required by the generated code other than for import.

* Ran generate-samples.sh
2024-05-13 16:48:59 +08:00
Thorsten Hirsch
3805cf366c
upgrade resteasy to junit5 (#18615)
* upgrade resteasy to junit5

* fix echo_api tests

* updated gradle/sbt/pom and generated samples with bin/generate-samples.sh

* fix xml syntax error

* forgot to run generate-samples.sh
2024-05-10 10:51:50 +08:00
Thorsten Hirsch
854e521a06
upgrade java native to junit5 (#18617)
* upgrade java native to junit5

* upgrade build.gradle, optimize imports

* upgrade gradle, re-generate samples

* migrate api_test.mustache and petstore tests of native-async & native-jakarta
2024-05-10 10:50:54 +08:00
Thorsten Hirsch
b67a019cf9
upgrade apache-httpclient to junit5 (#18616) 2024-05-09 09:54:32 +08:00
Nicklas Wiegandt
ef2fa03e96
[Java][Client] Add support for the new Spring RestClient (#18522)
* feat (JAVA SPRING RESTTEMPLATE) 17571: initial commit for Spring RestClient

* feat (JAVA SPRING RESTTEMPLATE) 17571: Copied and changed the webclient mustache files

The RestClient API is oriented on the WebClient API so many parts of the templates can be the same

* fix (JAVA SPRING RESTTEMPLATE) 17571: Renaming error & add README template

The README must be changed because the minimal Java Version for this client is 17

* fix (JAVA SPRING RESTTEMPLATE) 17571: Imports, compile errors and cookie setting

* feat (JAVA SPRING RESTTEMPLATE) 17571: Add generated samples

* test (JAVA SPRING RESTTEMPLATE) 17571: Add tests

* feat (JAVA SPRING RESTTEMPLATE) 17571: Update doc

* Add the restcilent to samples-java-client-jdk17.yam

The minimum Java version of the used Spring Version is 17

* fix (JAVA SPRING RESTTEMPLATE) 17571: Workflow paths to petstore samples

* fix (JAVA SPRING RESTTEMPLATE) 17571: Regenerated samples

* feat (JAVA SPRING RESTTEMPLATE) 17571: Generated echo-api sample for RestClient

* fix (JAVA SPRING RESTTEMPLATE) 17571: Missing import

* fix (JAVA SPRING RESTTEMPLATE) 17571: Missing body class exception when null body is set

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Auth test

* fix (JAVA SPRING RESTTEMPLATE) 17571: Gradlew file permissions

* feat (JAVA SPRING RESTTEMPLATE) 17571: Reggenerate samples after rebase

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api Body gif test

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api octet stream body test

* test (JAVA SPRING RESTTEMPLATE) 17571: Add echo-api multipart form data test

* fix (JAVA SPRING RESTTEMPLATE) 17571: Form as body when body is null

Also regenerated the restclient samples
2024-05-02 00:15:20 +08:00
William Cheng
2a1b4f90df
Add new option allArgConstructor for java client, spring generators (#18538)
* allArgConstructor for java

* Remove leftover from builder pattern branch

* Rename generateConstructorWithAllArgs and use x- in vendorExtensions

* Test issue #18340

* Add evidences for allVars issue (#18340)

* remove eol

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
2024-05-01 18:10:35 +08:00
Erko Risthein
bd02e65f88
[Java] Update Java version in GitHub actions (#18513)
* Update Java version in Github actions

* Generate samples

* [java] Upgrade Gradle wrapper to 8.7

* Generate samples

* [Java] Add resttemplate-jakarta to CI

* Upgrade CI machines to ubuntu-2204:2024.04.4 which use Java 21

* Change CI machines to ubuntu-2204:2024.01.1 which use Java 17

* Change CI machines to ubuntu-2004:2024.01.1

* [ruby] Update Gemfile.locks

* Use gradle wrapper for samples-java-client-jdk17
2024-04-30 13:57:01 +08:00
martin-mfg
c16f7f0aad
better example of user defined supporting file (#18512) 2024-04-27 15:35:49 +08:00
William Cheng
1bb4d42216
update readme, format code (php flight) (#18492)
* update readme, format code (php flight)

* add flight to the list

* update samples
2024-04-25 10:58:11 +08:00
William Cheng
1d67d0632d update samples 2024-04-23 21:32:52 +08:00
William Cheng
cbf52aefe4 update samples 2024-04-22 19:44:21 +08:00
martin-mfg
73bca68fea
add example for UserDefinedTemplates (#18423) 2024-04-22 10:46:15 +08:00
William Cheng
807250a430
Prepare 7.6.0 (#18412)
* Revert "v7.5.0 release"

This reverts commit 1eafe2aebf33b13bee0ead66d62a6436e7db059d.

* update master to v7.6.0 snapshot

* update readme

* update samples
2024-04-17 19:05:37 +08:00
Mike Friesen
97c1dc8a1a
#18252 - [REQ] add sessionToken support to AWS4Auth (#18253) 2024-04-11 11:56:40 +08:00
William Cheng
eb506ee776
[java][native] use type reference instead to fix compilation issue in JDK11 (#18346)
* use type reference instead to fix compilation issue in jdk11

* fix
2024-04-10 11:29:51 +08:00
William Cheng
a651376b18 fix java native compilation errors 2024-04-10 02:57:41 +08:00
William Cheng
d6749f8a0e update samples 2024-04-09 20:49:23 +08:00
Joakim Holm
3cb3fc2898
Add Generated annotations to more classes (#17736) 2024-04-09 16:39:53 +08:00
William Cheng
4719d9e55f
update spring-context to newer version (#18266) 2024-04-01 11:56:58 +08:00
timo-a
f73db59b0e
Migrate generated tests for java resttemplate generator updateFeature/resttemplate junit5 (#18222)
* update(resttemplate): migrate java resttemplate templates to junit 5

* update(java defaults): migrate java defaults as well because resttemplate uses model_tests from default

* update(samples, java): update samples as described in the contribution guidelines

* fix tests: try double quotes

* fix tests: remaining double quotes

* update(samples): regenerate resttemplate

* update(samples): regenerate resttemplate-jakarta

* update(samples): regenerate resttemplate-swagger1

* update(samples): regenerate resttemplate-swagger2

* update(samples): regenerate resttemplate-withXml

* update(samples again): ./bin/generate-samples.sh ./bin/configs/*.yaml
2024-03-30 21:06:05 +08:00
Harry Devane
6690b9f87d
Update okhttp3 to 4.12.0 (#18235) 2024-03-26 21:44:43 +08:00
William Cheng
e17777044e
Use systemPropertyVariables in pom.xml (#18213)
* use system property variables in pom.xml

* update
2024-03-23 21:45:29 +08:00
ふぁ
5e9546451c
[Python] Add echo_api test object serialization for multipart requests (#18176)
* [python] echo add test object serialization for multipart requests

* [echo api] update samples

* [echo api] update samples
2024-03-23 21:40:10 +08:00
Matteo Baccan
7565e365f8
Update pom.mustache (#18195)
* Update pom.mustache

* Updated pom.xml of samples
2024-03-22 15:05:32 +08:00
Flemming Nørnberg Larsen
a4508f6817
#18058 Fix the Java generator to generate valid @RequestMappings where the produce field takes list of string parameters instead of a single comma-separated string (#18092)
* #18058 Fix AbstractJavaCodegen.getAccepts() so it returns a String array instead of a comma-separated string, and fixed api.mustache so the @RequestMapping annotation generated produces for x-accepts as a parameter list instead of a (single) string.

* #18058 Updated test case to accept a string array instead of a comma-separated list.

* #18058 Reverted changes on imported compared to the main branch.

* #18058 getAccepts() is now hybrid, and can return both a single String or a String[].

* #18058 Rolled back the hybrid getAccepts(), so it only returns a String array.

* #18058 Updated mustache files to cope with vendorExtensions.x-accepts being a string array instead of a comma-separated string.

* #18058 Generated new sample files with by running `./bin/generate-samples.sh ./bin/configs/*.yaml`

* #18058 Optimization of getAccepts()

* #18058 Regenerated scripts that got broken after resolving conflicts on GitHub

* #18058 Fixed introduced issue with api.mustache causing a redundant accept with @HttpExchange with the PetApi.java, StoreApi.java, and UserApi.java.
2024-03-21 17:53:18 +08:00
William Cheng
7aeb952565 update samples 2024-03-21 11:42:51 +08:00
Ross Bender
b59957a095
Java API invocation flexibility (#18078)
* add direct invocation methods for java (httpclient)

* add direct invocation methods for java (resttemplate)

* handle methods only if endpoints exist for api client

* preserve previous newline to minimize changes

* update httpclient/resttemplate samples

* add common methods in base class

* regenerate samples with base class
2024-03-18 21:51:32 +08:00
Dennis Melzer
96bf7ac915
Fix default empty collections when collection is optional (#18080)
* Fix optional empty collection as default

* Fix test

* Fix test
2024-03-14 20:28:27 +08:00
William Cheng
4ff7e0ec3f
Prepare 7.5.0 snapshot (#18068)
* Revert "7.4.0 release"

This reverts commit eda049348425171df772a7b9087cc97db718cfda.

* prepare 7.5.0 snapshot version

* update samples

* update doc
2024-03-11 11:10:52 +08:00
Ross Bender
cf2435f335
Add support for controlling output of OpenAPI Generator version in generated files (#17952)
* add initial openapi config and java generated files

* add java implementation for adding generator version

* regenerate sample client files

* remove tabs

* only show generated version if build info exists

* set build info for batch generation

* update generator doc for new global flag

* use existing property for generator version

* update templates to include generator version

* update templates for better generator version syntax

* revert undesired changes

* regenerate samples for openapi client

* update templates to correct formatting/newlines

* correct description text and add to usage doc

* add generator cli option for all codegen types

* use more concise version info; update existing codegens to support new prop

* correct wrong prop reference

* add initial test coverage for new prop

* update last (scala) templates with new prop

* update samples after upstream merge

* use consistent version output

* use better sample project id/name

* revert using option for generator version in templates
2024-03-09 15:52:08 +08:00
Alex B
009fda5e3d
[JAVA][apache-httpclient] Use `EntityUtils#toString instead of Scanner` (#17998)
``EntityUtils#toString`` automatically selects the correct encoding based on the received request.
Scanner currently uses the JVM default encoding, which doesn't always work.
2024-03-02 21:18:49 +08:00
William Cheng
340a3eba54
update feign to newer version (#17983) 2024-02-28 14:11:42 +08:00
Andre Wachsmuth
8ca914d64f
[okhttp-gson] Make initializer block for GSON builder static #16860 (#16892)
* [okhttp-gson] Make initializer block for GSON builder static #16860

Make initializer block for GSON builder static, see #16860

* update sapmles

---------

Co-authored-by: Andre Wachsmuth <awa@xima.de>
2024-02-28 12:04:44 +08:00
Ross Bender
22c52d358c
Update Java templates to correctly close parenthesis (#17961)
* update java templates to correctly close parenthesis

* add closing parenthesis to missing java template
2024-02-26 15:24:31 +08:00
William Cheng
6e113842cf
[resttemplate] Update springweb to newer version (#17953)
* update springweb to newer version

* update
2024-02-24 23:43:15 +08:00
Simon Podlipsky
1e9bccca16
feat: generate EOL in VERSION file (#17829)
The EOL is missing so let's add it in order to comply with POSIX standard:

Line
> A sequence of zero or more non- <newline> characters plus a terminating <newline> character.
2024-02-12 15:40:55 +08:00
William Cheng
783e68c7ac
7.4.0 snapshot (#17818)
* Revert "7.3.0-release (#17817)"

This reverts commit d617b46c86b9075c5e0d63fe3798e2982f5259ac.

* update samples, docs, readme
2024-02-08 16:07:22 +08:00
Jonathan
f323a3e788
[Python] deserialize enum json response (fix #17789) (#17791)
* deserialize enum json response (python)

* adapt python samples: adding enum deserialization

* add echo test for enum json response deserialization (python)

* update samples
2024-02-08 10:52:43 +08:00
Jesenko Mehmedbasic
a092bbd83b
[BUG] [Java] Remove deprecation and serial warnings in ApiException.java and JSON.java (#17716)
* Add serialVersionUID to Java apiException.mustache templates

* Use 'enable()' and 'disable()' methods to handle object mapper features in JSON.mustache for the "native" Java generator instead of the deprecated 'configure()'

* Update samples
2024-01-27 10:42:27 +08:00
William Cheng
d0187ab359
Add tests for query parameters (array of integer/string) (#17686)
* add tests for query parameters in python client

* update other samples

* update samples
2024-01-24 10:20:18 +08:00
Marc Weiß
76560e34c9
replace deprecated ISO8601Utils with StdDateFormat (#17052) 2024-01-11 18:24:52 +08:00
Jorge Rodríguez Martín
61c40474af
[BUG][java][resttemplate] Fix NPE when query param with value null is exploded (#17568)
* Fix NPE when query param with value null is exploded

* Polish

* Add test

* Update tests

* Add integration test
2024-01-10 23:39:41 +08:00
Hansjörg Oppermann
8bab0ceb53
Generated methode ApiClient.parameterToPairs failed to handle empty collections #17460 (#17463)
* #17460 add missing empty collection check

* generate samples
2024-01-10 02:29:10 +08:00