1690 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
ef36ea410e
Fix method naming for openapi normalzier, openapi ignore list option (#18348)
* fix openapi normalizer naming issue in config

* update openapi generator ignore list setting

* update

* fix

* update sample config

* update doc
2024-04-10 17:09:48 +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
edd91063b4 hide generation timestamp in java microprofile samples 2024-04-10 02:33:01 +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
2168851e8a
Better array handling in 3.1 spec (#18313)
* better array detection in 3.1 spec

* fix
2024-04-07 15:48:19 +08:00
William Cheng
3d2e38e347
add tests for query parameter (array of enum) in 3.1 spec (#18310) 2024-04-06 14:36:41 +08:00
William Cheng
6d10e80916
[normalizer] fix schemas incorrectly skipped (#18297)
* fix circular reference check in normalizer

* add new files

* fix
2024-04-05 13:55:22 +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
William Cheng
e78aeb6bc7
Better support for $ref to schema's properties (#18233)
* use once

* add support for reference to schema properties
2024-03-27 11:46:00 +08:00
Harry Devane
6690b9f87d
Update okhttp3 to 4.12.0 (#18235) 2024-03-26 21:44:43 +08:00
William Cheng
e0b059bcde update samples 2024-03-24 18:14:15 +08:00
William Cheng
6746be9a50 fix allOf handling in 3.1 spec 2024-03-24 18:07:01 +08:00
William Cheng
d88023f833
fix ref to request bodies in form content type (#18216) 2024-03-24 11:38:21 +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
William Cheng
09af44eca3
[java] update jakarta.validation-api to 3.0.2 (#18124)
* fix: jersey3 library

fix issue that library failed in case pattern matching was used in
the api.

* add tests, update version

* update

* fix tag

* fix, update samples

* update build

* more update

* update workflow

* test useJakarta

---------

Co-authored-by: holomekc <30546982+holomekc@users.noreply.github.com>
2024-03-20 12:55:19 +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
William Cheng
f61b7c2aa4 remove generator version sample test and config 2024-03-09 15:55:46 +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
gf-smtzgr
2d155105a4
Added jackson as supported serialization library for retrofit2 (#16853)
* added jackson as supported serialization library for retrofit2; resolves #7435

* Jackson support for retrofit2 library: Adjusted ApiClient to respectively include only gson or jackson specific conversion support depending on which serialization framework is selected

* Jackson support for retrofit2 library: Adjusted dependencies to respectively only include those necessary for gson or jackson depending on which serialization framework is selected

* reorder converter factory additions to have minimal change

* -: skipping gson-fire dependency when gson is not selected

* -: Jackson support for retrofit2 library: since useplayws implies jackson usage, only adding dependencies via useplayws that are specific to it

* Jackson support for retrofit2 library: fixed whitespace issue in generated api clients

* Jackson support for retrofit2 library: removed duplicated play26 dependency version property

* Jackson support for retrofit2 library: update to play26 example as that had gson dependencies but does not seem to use it and now fully relies on the jackson setting to control the respective dependencies; play version property and dependency changed place because the jackson dependencies are grouped together and the play26 ones are placed after

* Jackson support for retrofit2 library: adjusting dependencies also for gradle file

* -: moved jackson databind version out of jackson section since it is used independently of jackson support it seems

* -: update gradle dependencies to match changes in maven dependencies
2024-03-04 12:50:42 +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
Ruokki
149246de31
fix(java): resolve feign ambiguity in ApiErrorDecoder fix(#17842) (#17843) 2024-02-28 12:06:57 +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
0b02734b93
better handling of allOf in request/response (#17964) 2024-02-28 11:19:11 +08:00
William Cheng
51ef501c02
fix npe by prefixItems in normalizer 3.1 spec (#17955) 2024-02-26 15:24:55 +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
William Cheng
436a3e0744
fix multi line description in allOf (#17879) 2024-02-16 15:26:15 +08:00
William Cheng
809c90aa24
Use unescaped media type in java native client (#17872)
* use unescaped media type in java native client

* add tests
2024-02-16 10:17:08 +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
Vasilii Sorokin
be81652269
[java] 14404 fix for json arrays (#17812) 2024-02-08 11:19:08 +08:00
William Cheng
7c7634dda9
add operation id option (#17750) 2024-02-01 17:21:49 +08:00
William Cheng
59f672d9aa
Add rule to remove x-internal in openapi normalizer (#17734)
* add rule to remove x-internal in normalizer

* update

* update doc

* better code format

* update samples
2024-01-30 21:11:25 +08:00
martin-mfg
9afea50cab
use map/array model class only if it is generated (#17612)
* fix

* tests

* generate samples

* refactor
2024-01-29 21:35:21 +08:00
dmbakker
9952776e9c
[java] fix Use jackson-jakarta-rs-json-provider when useJakartaEe is true (#17600)
* fix #17590 - use jackson-jakarta-rs-json-provider instead of jackson-jaxrs-json-provider in pom when useJakartaEe is true

* fix #17590 - fix indentation

* fix #17590 - updated samples

* fix #17590 - fixed groupid

---------

Co-authored-by: in376bak <dennis.bakker@duo.nl>
2024-01-28 00:38:18 +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
dccb147055
Fix allOf with a single item in inline model resolver (#17683)
* fix inline model resolver for allof with 1 item

* add files

* update sha

* more checks
2024-01-23 23:37:39 +08:00