158 Commits

Author SHA1 Message Date
Mike Friesen
97c1dc8a1a
#18252 - [REQ] add sessionToken support to AWS4Auth (#18253) 2024-04-11 11:56:40 +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
83b45fd1e8
[java][okhttp-gson] Fix oneof, anyof for array type (#18324)
* fix oneof, anyof for array type in java okhttp-gson

* fix oneof

* fix add tests

* clean up comments

* update

* add new files
2024-04-08 22:20:23 +08:00
William Cheng
88204b247a
[Java] Sync jersey2 jersey3 template (#18281)
* sync jersey2 and 3 templates

* add deprecated

* update samples
2024-04-03 16:32:39 +08:00
William Cheng
4719d9e55f
update spring-context to newer version (#18266) 2024-04-01 11:56:58 +08:00
B4ckslash
807aa5d3ae
[Java][jersey2] Fix generated client code for oneOf models if datatype includes arrays (#18042)
* Add java-jersey2 sample with mixed oneOf

* [java][jersey2]Fix client generation if oneOf contains an array type

Changes:
* Change jersey2/oneof_model template to use composed schema data
* Change adding of imports in AbstractJavaCodegen to use composed schema data
* Add escapedDataType property to CodegenProperty so that the data type
  may be part of identifiers (e.g. in getters)
* Update samples

* Add sample for multiple array in oneOf

* Fix generation of constructors with same erasures

* Update samples again

* Version bump

* Add new sample folders to CI

* Make primitive handling more explicit

* Replace escapedDataType property with Mustache lambda

* Update samples with new primitive handling and sanitization lambda
2024-03-30 21:08:41 +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
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
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
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
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
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
Marc Weiß
76560e34c9
replace deprecated ISO8601Utils with StdDateFormat (#17052) 2024-01-11 18:24:52 +08:00
William Cheng
4acbd69c3d update samples 2024-01-06 15:29:09 +08:00
Ilamparithi Natarajan
ddc7d4b1b5
[java][resttemplate] rethrow original exception when retry limits exceeded (#17488)
in rest template, when the retry limits exceeded
rethrow the original exception

also add 429 (Too many requests) status code to the
retry logic

fix #17478
2024-01-05 09:57:24 +08:00
William Cheng
5eab3cef19
Prepare 7.3.0-SNAPSHOT (#17456)
* Revert "v7.2.0 release (#17455)"

This reverts commit fe638d009363c142c246ff089032f243e0b4ee01.

* set version to 7.3.0-SNAPSHOT

* update doc
2023-12-22 16:55:58 +08:00
dabdirb
e63563a8fc
fix #16889 replace deprecated response code function (#17405) 2023-12-15 13:41:14 +08:00
rubiniselvaraj
4c4388e3c8
Fix for handling error in resttemplate (#17381)
* Fix with handling error

* Fix with handling error
2023-12-13 12:56:02 +08:00
rubiniselvaraj
a792a79059
Implementing retry logic to restTemplate (#17375)
* Implementing retry logic to restTemplate

* Fixing the issue

* Adding import

* Fix

* Fix

* minor update, add tests

* fix

* Adding the maxRetryAttempt, threadWaitTime as additionalProperty

* Updating the apiClient

* Removing reduntant variable

* Generating samples

* Fixing format

---------

Co-authored-by: Rubini <rubini@Rubinis-MacBook-Air.local>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2023-12-12 22:01:36 +08:00
Tomohiko Ozawa
4bedeef643
[Java][apache-httpclient][feign][okhttp-gson] Enable access token refresh (#17086)
* add setter of bearer token supplier

* run generate-samples.sh

* add test of bearer auth
2023-11-18 12:46:18 +08:00
William Cheng
07620cebe2
update webclient dep to newer version, add tests (#17106) 2023-11-17 10:34:22 +08:00
Charles Treatman
c8b3da7388
[Java][okhttp-gson] remove unreachable code from templates (#17057)
* Remove checks for jackson and jsonb from okhttp-gson templates

* regenerate samples
2023-11-14 11:13:28 +08:00
William Cheng
53289263d9
Prepare v7.2.0 (#17050)
* update version to 7.2.0-SNAPSHOT

* update samples

* update doc
2023-11-13 18:53:20 +08:00
Charles Treatman
166ebc50b0
[Java][okhttp-gson] validateJsonElement does not validate enum values (#16865)
* validate enum properties in validateJsonElement

* regenerate samples

* add test for enum validation in okhttp-gson models
2023-11-08 14:14:48 +08:00
Marc Weiß
74163f0ac8
bump gson-fire to 1.9.0 (#17002) 2023-11-07 22:35:05 +08:00
Ben Madore
d6421411c9
chore: remove unused commons logging imports from java webclient (#16839)
Co-authored-by: Ben Madore <ben.madore@glassdoor.com>
2023-10-17 13:33:34 +08:00
martin-mfg
b6db4f73f1
[JAVA] fix: oneOf generates incorrect model for primitive types (#16834)
* generate samples

* try fix

* add new sample for fixed case

* also improve native library

Other libraries don't need fixes.

* add oneOf_twoPrimitives.yaml

* generate samples

* resolve comment
2023-10-16 22:18:52 +08:00
martin-mfg
e3db882ed4
[JAVA][KOTLIN][SPRING] upgrade dependencies (#16759)
* upgrade spring-boot-starter-parent

* upgrade springdoc and swagger-ui

* upgrade v3 swagger-annotations

* generate samples

* upgrade jackson

* fix spring cloud, remove temp comment

Putting "8" instead of "1.8" should be ok, because Spring Boot 3 requires Java 17 anyway, so it should be able to understand that 8 is the same as 1.8.

* generate samples

* upgrade JUnit 5, remove commons-io dependency, remove outdated samples/client/petstore/java/feign/feign10x/ files, generate samples

commons-io dependency was introduced in https://github.com/OpenAPITools/openapi-generator/pull/8484, but I don't see why it would be needed now or back then.

* update gson, generate samples

* update logback

* update feign

* update scribejava

* generate samples

* update httpmime

* okhttp-gson: update commons-lang & okhttp & junit-platform, remove mockito; generate samples

It seems Mockito is not used at all there.

* okhttp-gson: remove unnecessary sample files, generate sample files

* upgrade google-api-client & jersey-common, restore ClientTest, generate samples

* misc. upgrades in jersey2 and jersey3

jersey 3.1.3 is available already, but IntelliJ reports security problems in 3.1.3 and 3.1.2, so I used 3.1.1 instead.

* align some gradle&sbt files with poms, generate samples

* whitespace fix
2023-10-09 14:55:32 +08:00
William Cheng
a1d00e4785
[Java][okhttp-gson] fix AWS auth issue (#16721)
* fix samples

* fix awsauth in okhttp gson java client

* update github workflow
2023-10-04 18:28:50 +08:00
Jan Gosmann
7087b332f0
Replace deprecated Gradle properties (#16695)
* destinationDir -> destinationDirectory (scheduled to be removed in Gradle 9.0)
* archiveName -> archiveFileName (removed in Gradle 8.0)

Cp. https://docs.gradle.org/current/userguide/upgrading_version_7.html
2023-10-04 16:24:05 +08:00
William Cheng
0f2a27d3c5
add tests for useAbstractionForFiles option (webclient, resttemplate) (#16644) 2023-09-22 12:51:50 +08:00
William Cheng
5e8e2d7f6d
Prepare v7.1.0 in master (#16608)
* prepare v7.1.0 in master

* update
2023-09-18 17:37:36 +08:00
William Caine
134dc98a71
fix: Using Map.Entry to avoid "reference to Entry is ambiguous" (#16445)
* fix: Using Map.Entry to avoid "reference to Entry is ambiguous"

when spec defines a model Entry it conflicts.  Also rest of mustache
uses  Map.Entry to matching it

* fix: Map.Entry - update samples
2023-08-30 12:57:53 +08:00
William Cheng
80121aa88f
Prepare v7.0.1 (#16409)
* prepare 7.0.1 in master

* update doc
2023-08-25 16:11:29 +08:00
William Cheng
ff19825610
[java] Remove hardcoded arrays in template (#16340)
* remove hardcoded arrays in template

* better model import in java client

* update

* better code format

* minor refactoring

* update
2023-08-19 10:20:48 +08:00
William Cheng
5b2ceac93d
fix anyOf in handling primitive types in java client (#16264) 2023-08-06 13:48:13 +08:00
William Cheng
82516c75d2
Fix implements in oneof, anyof templates in java okhttp client generator (#16241)
* fix implements in oneof, anyof templates in java okhttp

* add tests

* update samples
2023-08-03 21:09:00 +08:00
Marc Miltenberger
adac3b127f
Support for multipart/form-data; charset="utf-8" in Java GSON Generator (#16211)
* Support for multipart/form-data; charset="utf-8"

Previously, it was only checked for an exact equal string, which failed when there were additional options such as charset.

* Update samples
2023-07-29 00:22:19 +08:00
karzang
e9d98666a1
[Java][Client] Fix #12556 Support primitives and arrays in oneOf (#13897)
* [Java][Client] Fix #12556 Support primitives and arrays in oneOf

* Regenerate petstore samples

* Regenerate petstore test samples

* Treat 'BigDecimal' as primtive datatype

* Fix integration tests
2023-06-29 16:46:55 +08:00
bcalvez
7a73f75f70
[java][okhttp-gson] Remove JAX-RS dependency from generated okhttp-gson java client (#15896)
* Remove JAX-RS dependency from generated okhttp-gson java client

* update samples

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2023-06-27 16:53:10 +08:00
Frederic Jones
59ba00e1f3
Add support for swagger2 in [java] client generators (#15456)
* Add support for swagger2 in java client generator

* Target 7.x.x

* Upstream changes
2023-06-06 15:41:12 +08:00