126 Commits

Author SHA1 Message Date
William Cheng
51ef8683fb
[java] implement #18032 add builder pattern to java client and spring generator (#18650)
* add builder pattern to java client and spring generator

* regenerate samples

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
2024-05-14 11:38:30 +08:00
kiwi-oss
dec8a430df
[Microprofile] Add option to use tags a client keys and server generator (#16673)
* [Java/Microprofile] Add support for Jackson serialization & async interfaces using Mutiny in Java Microprofile library

* Regenerate samples & docs

* Add server generator

* Update client to set configKey by classname

* Remove debug remains and comments

* Adapt method override to upstream changes

* Regenerate samples

* Revert "Regenerate samples"

This reverts commit b5bcbdea90c71a2819a3ea6339c3878f249f97b4.

* Move additional 2xx response to dedicated OpenAPI document

Some other generators than those for Micronaut don't seem to be able to
handle this case, so we don't add it to the general pet store document.

* Make filename consistent with other files in the folder

* Regenerate Microprofile client and server samples

* Generate samples

* Update documentation

* Generate samples

* Remove left-over `*.orig` files from Git merges

* Regenerate samples

* Regenerated samples

* changed generator name to "java-microprofile"

* added the new folder to .github/workflows/samples-java-server-jdk8.yaml so that CI will test it moving forward

* Renamed JavaMicroprofileServerCodegen.java

* regenerated samples

* only enable configKeyFromClassName if configKey is not set

* Updated documentation

* Change samples to use junit 4

* Fix junit 4 test classes

* run ensure up-to-date script

* fix kotlin test errors

---------

Co-authored-by: pravussum <pravussum@users.noreply.github.com>
Co-authored-by: frank <frank.buechel@kiwigrid.com>
Co-authored-by: Oscar <oscar.obrien@kiwigrid.com>
Co-authored-by: oscarobr <133783370+oscarobr@users.noreply.github.com>
2024-05-07 16:24:23 +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
William Cheng
3bd6d67cc0
(java client) minor code enhancements (#18493)
* (java client) minor code enhancements

* update doc
2024-04-25 12:51:18 +08:00
William Cheng
b2a7f435c8
"==" enum value generates "_" in Java which is invalid since Java 9 (#18338)
* #17276 "==" enum value generates "_" in Java which is invalid since Java 9

* update doc

---------

Co-authored-by: Julien BÉTI <jbeti@cosium.com>
2024-04-09 12:21:54 +08:00
martin-mfg
aad345f0bd
expand documentation for option "artifactVersion" (#17845)
* update documentation strings

* re-generate docs
2024-02-13 16:18:05 +08:00
Tiffany Marrel
42f72192ca
add security feature AWSV4Signature to documentation (#15603) 2023-12-13 15:07:18 +08:00
Vignesh
87b86c78dc
feat: Support useSingleRequestParameter feature for java microprofile client generation (#17072) 2023-11-21 11:56:11 +08:00
martin-mfg
1cff462d90
remove jersey 1 (#16646) 2023-09-26 09:10:11 +08:00
William Cheng
70bffffc5a
remove option, update doc (#16592) 2023-09-15 15:01:21 +08:00
prashant-pant
4b87606665
Autoset constants (Required fields having single valid enum value) Java (OkHttp) Implementation of #16547 (#16550)
* Autosets the parameters with the only value specified as enum if the parameter is also marked as required

* Autosets the parameters with the only value specified as enum if the parameter is also marked as required

* Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client.

* Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client.

* Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client.

* Autosets the parameters with the only value specified as enum if the parameter is also marked as required for Java default client.
2023-09-15 14:41:17 +08:00
Jim Simon
9cc5513a1c
Fix Issue 16385 (#16387) 2023-08-30 14:23:53 +08:00
Jonathan Wenger
d9001b8a6f
Add additional reserved words for java and csharp (#16276)
Co-authored-by: Jonathan Wenger <jonathan.wenger@avalara.com>
2023-08-09 14:30:22 +08:00
karzang
e299382a42
[Java][Client] Fix handling of 'number' types in oneOf (#16202) 2023-08-06 11:16:50 +08:00
William Cheng
9a968c3104
add supportUrlQuery as an option (#15958) 2023-06-30 14:20:27 +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
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
Tiffany Marrel
79c2e87890
[Java] fix security features listed in documentation (#15756) 2023-06-06 15:12:22 +08:00
martin-mfg
ad5cc827f0
remove fullJavaUtil (#15033) 2023-05-22 14:40:35 +08:00
Tiffany Marrel
00676870a3
add HTTP signature to SecurityFeature (#15542) 2023-05-17 00:48:58 +08:00
William Cheng
737cb362b0
add option, update doc (#15419) 2023-05-05 14:59:33 +08:00
Jorge Rodríguez Martín
76c05b2991
Add property generateClientAsBean for config creation of ApiClient.java and XXXApi.java (#15416) 2023-05-05 14:18:44 +08:00
Robbert van Waveren
8a426b2f4a
allow to specify the useOneOfInterfaces option for java (#15042) 2023-04-12 15:21:34 +03:00
William Cheng
88da3649b2
[csharp-netcore] Add option skip generating getter for sub-schemas (#15007)
* add option skip generating getter for sub-schemas

* fix openapi-yaml

* update samples

* update samples
2023-03-21 22:41:29 +08:00
Andre Vegas
d7edbad8d6
[java][apache-httpclient] update httpclient dependency to the latest 5.x (#14673)
* #14672 - adding generator with apache http client 5

* #14672 - adding generator with apache http client 5

* #14672 - adding generator with apache http client 5

* #14672 - adding generator with apache http client 5
2023-02-15 15:12:39 +08:00
pravussum
4f1708c3fb
[Java/Microprofile] Add support for Jackson serialization & async interfaces using Mutiny in Java Microprofile library (#11554) 2023-02-03 19:39:01 +08:00
William Cheng
fd45b74128
[Java] better default value handling (#14130)
* add test for array default value

* update null return

* minor fixes

* move default value tests to echo api spec

* add new files

* remove unused files

* fix enum array default, add tests

* better array init

* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>

* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>

* revert the fix

* improve default value handling

* update native samples, add tests

* update samples

* fix tests

* use conditional test for timezone

* add tests to apache http client echo api

* add option to default container to null

* fix map default value

* minor refactoring

* update samples

* fix javadoc

* fix pom.xml

* add tests in java native echo client

* add java apache client echo tests

* fix test

* fix test

---------

Co-authored-by: Leonard Brünings <lord_damokles@gmx.net>
2023-01-30 20:19:00 +08:00
William Cheng
079ad1742e
update useRuntimeException description (#14452) 2023-01-13 17:38:31 +08:00
Maxime Dufour
c6ea564600
[Java][Client Default] Support of AWS Signature V4 (#14287)
* Add support of AWSV4 Signature in Java

* Add Petstore sample for AWSV4 Signature

* Update other sample examples

* Sync Documentation and sample

* Specify only available for okhttp-gson in doc
2023-01-10 19:29:20 +08:00
Paul Parenko
456cca1a28
[Java] Fix #14276 Java Templates uses jakarta or javax package if useJakartaEe is enabled (#14343)
* Fix #14276 Java Templates uses jakarta or javax package if useJakartaEe
is true

* generated samples after useJakartaEe changes

* generated docs after useJakartaEe changes
2023-01-02 16:28:44 +08:00
John Mitchell
2a33229158
Support for GSON Decoder in Java Feign Generator (#14254)
* Supporting Gson decoder in Feign

* Supporting Gson decoder in Feign

* Fixing test failures - and ensuring Jackson is used as the default if nothing selected (back compatible)

* Adding in sample files

* Updating docs

* Switching to echo server version

* Adding feign-gson to the github workflow

* Empty-Commit
2022-12-17 15:40:14 +08:00
Oleh Kurpiak
2524e8fb0a
[Java][WebClient] global blocking operations config (#14076)
* [Java][WebClient] global blocking operations config

* update samples
2022-12-06 13:30:47 +08:00
Oleh Kurpiak
95b566a3a9
[Java] fix additional annotations for oneOf interfaces (#13958) 2022-11-20 12:44:47 +08:00
cachescrubber
5221682086
[Java][Client] Support annotationLibrary=none to remove swagger annotations (#13869)
* Support annotationLibrary=none in JavaClientCodegen

* Add example using annotationLibrary=swagger1

* Support annotationLibrary=none in libraries

* Fix missing curly brace.

* fix if statement condition

* Support {{#swagger1AnnotationLibrary}} in java/rest-assured

* Adopt JavaModelTest

* Generate docs

* Generate samples

* clean up java feign files

* clean up feign samples

* fix resttemplate, native

* fix resttemplate withXml

* fix webclient

* fix java-jersey2, vertix

* fix googleapi client

* fix rest assured

* fix rest assured

* update apache-httpclient

* fix jersey2 special character

* fix resteasy

* fix jersey2

* update samples

* fix jersey2, okhttp streaming

* update okhttp-gson

* update samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-11-04 17:07:46 +08:00
Thibault Duperron
574a70c315
[JAVA] Handle camlCase with $ as first char (#13292)
* Lowercase first char and not first letter for variable names

* Samples

* Limit caml case fix impact with cli a property
2022-10-28 21:36:04 +08:00
William Cheng
c2595335c3
[java] Add useSingleRequestParameter support (#12580)
* add useSingleRequestParameter support to java client

* trigger build failure

* trigger build failure

* Revert "trigger build failure"

This reverts commit 545e57ab8f3d943d9ad6ad114841a37d3b01a47b.

* Revert "trigger build failure"

This reverts commit 849f71f1f1a28659b0fd375986d7e66e9c6d04ac.

* update doc
2022-06-12 17:23:42 +08:00
Andrii Serkes
783f810a05
Allow selection of MP REST API version for MicroProfile REST client g… (#12043)
* Allow selection of MP REST API version for MicroProfile REST client generation

* fix typo in pom.xml

* fix typo in pom.xml, update samples

* add exception when incorrect MP Rest Client version is chosen
2022-04-20 14:29:43 +08:00
Justin Black
e2e7609bac
Adds not to CodegenComposedSchemas and uses it in python-exp (#12146)
Updates docs
2022-04-17 09:36:09 -07:00
Justin Black
eef7cddd6f
Adds UUID to python-experimental (#12153)
* Adds UUID to python-exp, allows uuid models to be generated

* Adds test_UUIDString uuid model test

* Fixes uuid properties in python-exp, changes maps to object data type, adds uuid data type

* Adds maps data type back in

* Adds missing Null and AnyType definitions and adds them to python-experimental

* Generator docs updated, added missing uuid, null, anytype, and object

* Adds uuid support description

* Docs updated
2022-04-16 14:55:49 -07:00
William Cheng
cd41bc824b
[java] Add jersey3 support to the Java client (#12046)
* add jersey3 client support

* update code to support jersey3

* test jersey3 in ci

* update doc

* update sbt, gradle build files
2022-04-05 17:23:37 +08:00
William Cheng
5d8b80a5cd
[Java] rename x-contentType to x-content-type (#11895)
* rename x-contentType to x-content-type

* undo changes
2022-03-18 09:50:42 +08:00
Oleh Kurpiak
860b6340a8
[Java] update list of vendor extensions (#11891) 2022-03-17 09:31:45 +08:00
Oleh Kurpiak
fb2c41c720
[Java] implicit headers regex (#11819) 2022-03-10 10:49:52 +08:00
Oleh Kurpiak
382e2a22a8
Document all used vendor extensions in specific generator (#11797) 2022-03-06 23:21:55 +08:00
William Cheng
5764469051
[Java] Add useOneOfDiscriminatorLookup option (#11736)
* add useOneOfDiscriminatorLookup option to java client generator

* remove null
2022-02-27 16:50:29 +08:00
Rodrigo Cebrián González
03cca89b80
✏️ Fixed typo error on java generator config-help command (#11644)
Fix the typo error "proeprties" to properties inside the gradleProperties config for java generator
2022-02-18 11:09:00 +08:00
William Cheng
8455c1cd23
Remove the option to support JDK7 from Java generator and templates (#11547)
* remove java8 from java client generator and templates

* update tests

* remove threetenbp

* update spring templates to remove java8

* remove java8 from jaxrs template

* fix jaxrs spec

* fix feign

* remove CustomInstantDeserializer.java

* fix jersey1

* fix undertow

* various update

* fix jaxrs jersey1

* fix java inflector

* fix jaxrs cxf

* add new files

* update doc
2022-02-10 10:35:29 +08:00
William Cheng
51800471fa
[java][Okhttp] replace okhttp-gson with okhttp-gson-nextgen (#11538)
* replace okhttp-gson with okhttp-gson-nextgen

* add new files

* update doc

* clean up pom

* update test

* restore error handling in doc

* add back changes

* uncomment tests

* update samples
2022-02-08 00:05:44 +08:00
William Cheng
3ed6343933
remove deprecated options in java client generator (#11456) 2022-01-30 15:57:02 +08:00