133 Commits

Author SHA1 Message Date
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
feech
34395c3173
Makes the maven plugin to generate Model-tests and API-tests in generated-test-sources (#11294)
* added support for independent test-folder

* generate updated docs

* generate updated docs

* generate updated docs

* trigger a new CI builds

Co-authored-by: William Cheng <wing328hk@gmail.com>
2022-01-26 16:32:09 +08:00
Justin Black
78f4748c06
Adds generator default template engine (#11366)
* Revert "Revert "Has generators set default template engine (#11245)" (#11316)"

This reverts commit 57987424a4eaa22d73337388489cd86d7f42a023.

* Only loads in the default template engine if the config file contains the generatorName

* Only sets templatingEngineName using condif default in one place

* Adds config files that lack generatorName

* Revert "Adds config files that lack generatorName"

This reverts commit 7dafc93c0f02c037d9be5d2c0a3ee7377c8b479d.

* Adds generator default templating engine to the generator metadata
2022-01-23 14:16:46 -08:00
William Cheng
33bce99b8e
Avoid using import mapping in model generation (#11217)
* remove import mapping logic in model generation, better handle of file, list

* add new files for file, list

* fix some tests

* update tests, doc

* skip file as reserved word in feign client

* add new files

* remove file from reserved word list in spring generator
2022-01-16 23:57:53 +08:00
Justin Black
de036e211e
Improves generator docs: stability + language version added (#11270)
* Adds generatorLanguageVersion and uses it in python generators

* Regenerates docs

* Adds stability to generator docs

* Triple braces generatorLanguageVersion

* Regenerates samples

* Fixes the python-experimental setup.py file so it works with generatorLanguageVersion

* Updates generators readme
2022-01-10 18:16:53 -08:00
Justin Black
0eca629127
Adds generatorLanguage to all generators (#11268)
* Adds generatorLanguage to all generators

* Adds all generator languages and info to docs

* Docs updated
2022-01-10 12:13:35 -08:00
Justin Black
d813d04f46
Improves generator docs, adds metadata section (#11262)
* Refactors generator md creation, adds generateMdMetadata

* Removes extra space

* Adds docs updates

* Fixes table definition for metadata

* Docs update

* Docs update

* Updates title, removes sidebar_label because it was not doing anything on pages like https://openapi-generator.tech/docs/generators/android

* Docs updated
2022-01-09 14:10:47 -08:00
William Cheng
e3788ce44e update doc for okhttp-gson-nextgen 2021-12-21 15:48:47 +08:00
Bruno Coelho
c305c71715
[DefaultCodegen] generate unknown default case (#11078)
* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] replace Swift custom implementation with the DefaultCodegen implementation

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] update docs

* [DefaultCodegen] fix Swift enum case name

* [DefaultCodegen] generate unknown default case

* [DefaultCodegen] generate unknown default case
2021-12-21 15:40:13 +08:00
William Cheng
550c0781dc
[okhttp-gson-next-gen] new option for error object (#10995)
* add error body and type to api exception class

* add option to specify error object

* add option, update api doc with better error handling

* update samples

* update doc
2021-12-10 02:08:17 +08:00
William Cheng
b061bd2146
[Java][Okhttp] Add oneOf support (#10875)
* add custom gson deserializer

* add check for additional fields, required fields

* add tests for custom deserializer

* add custom adapter

* add custom adapter

* register type adapter factory

* comment out custom deserializer and use adapter instead

* add okhttp-gson-nextgen

* add new files

* restore okhttp-gson

* switch to adapter

* remove custom de/serializer

* add comment

* update tests

* test nextgen in ci

* update doc

* use full model name in JSON.java

* undo changes

* add oneof discriminator support

* fix anyOf

* remove mappings

* add more tests

* fix oneof deserialization, add more tests

* add error body and type to api exception class

* JSON to use instance variables/methods

* Revert "add error body and type to api exception class"

This reverts commit 07f34e2c450ad9f808b728173018b1e4d8fed458.
2021-11-30 15:33:42 +08:00
William Cheng
5e857e749d
add an option for configKey (#10707) 2021-10-27 15:07:41 +08:00
William Cheng
fcef9fab63
update doc for java useAbstractionForFiles option (#10677) 2021-10-24 16:21:28 +08:00
William Cheng
8069d183f3
[Java] Add streaming endpoint support (#9813)
* add streaming endpoint support to java client

* update doc
2021-10-24 16:02:49 +08:00
William Cheng
96c65fea61
[Java] add an option to customize gradle.properties (#10540)
* add an option to customize gradle properties

* add more info to gradle.properties
2021-10-08 11:20:50 +08:00
Nathan Baulch
5d68bd6a03
Fix thousands of spelling typos (#10272) 2021-08-28 22:58:24 +08:00
William Cheng
badfdccd5e update doc 2021-08-25 10:25:11 +08:00
William Cheng
3de5483aa0
[JAVA] Add apache httpclient library to java clients (#10218)
* Add apache java client option

* Add sample apache client config

* Switch serialization library, use time formatter

* Add pom template for apache dependencies

* Add initial implementation of ApiClient using apache

* Add apache api template

Plus switch to TypeReference to handle generic types

* Add support for sending json data

* Generate test stubs with @Ignore

* Add accept header

* Remove unnecessary builder assignments

* Set responseHeaders instance variable

* Switch to general serialize / deserialize functions

* Handle sending url encoded form data

* Split response processing into new method

* Allow requests without body

* Use general HttpResponse interface

If the method doesn't need to close it

* Use clients connection timeout

* Add constructor accepting custom client

* Handle multipart and direct file uploads

* Support file downloading

Based on the implementation in the jersey client

* Handle missing content disposition

* Raise error if body given for an unexpected method

* Use try with resources for response handling

* Remove unused url parameter encode method

* Handle content type parse exception

* Improve response content type handling

Would have had issues with content type headers containing a charset

* Make all set methods return client

* Add basic readme

* Send content type with files

* Set domain and path on cookies

Otherwise they will be excluded from the request

* Use consistent quoting in error messages

* Add generated apache sample

* Add generated docs changes

* update samples

* rename library, update samples, docs

* update readme

Co-authored-by: Harry White <hwhite@atlassian.com>
2021-08-22 11:17:31 +08:00
Johannes Wienke
f47dc4d84b
Document JSON-B as microprofile client target (#10172)
The documentation for the Java microprofile client wrongly states that
Jackson is used. This commit corrects this to JSON-B.

Relates to: #8015
2021-08-21 22:32:04 +08:00
Guillaume TOURBIER
9ece1b5111
[Java] refactor: improve additionalModelTypeAnnotations generation (#8269)
* refactor: improve additionalModelTypeAnnotations generation

Split by ';' and/or newline
Trim value

fix: #7032

Run ./bin/generate-samples.sh to regenerate model files

Revert "Run ./bin/generate-samples.sh to regenerate model files"

This reverts commit da509c39f363da046fbd457e1ab67ef0f62f3561.

refector: remove unnecessary import

test: multiples tests for AdditionalModelTypeAnnotations

Add a getter to test the list

refactor: remove duplicate AdditionalModelTypeAnnotations

Without using Set to avoid any side effect somewhere, I use stream and
distinct to avoid duplicates

refactor: using Set instead of stream

Remove stream distinct for performance reason, use newHashSet
Keep AdditionalModelTypeAnnotations as List

doc: update info additionalModelTypeAnnotations

refactor: move doc in code for autogen

style: tab in java class

doc: run ensure-up-to-date

refactor: add imports lost in rebase

docs: regenerate docs

docs: update

* fix: docs
2021-08-17 18:10:19 +08:00
Justin Black
8226269101
Fixes legacyDiscriminatorBehavior description (#8931)
* Fixes description

* Samples and docs updated
2021-03-08 13:39:12 -08:00
Oleh Kurpiak
976b4aa757
[Java] Additional enum type annotations (#8389)
* [Java] Additional enum type annotations

* [Java] Additional enum type annotations
2021-03-04 23:33:00 +08:00
Dheeraj Nalluri
264b017eec
[Java][Client] JSON-B serialization support (#8729)
* Added JSON-B support.

* Mention jsonb in docs
2021-02-27 15:32:46 +08:00
William Cheng
84813be309
remove supportJava6 option (#8514) 2021-01-26 10:27:09 +08:00
Christophe Bornet
f2d8e3a25b
[Java/okhttp] Add dynamic operations option (#7916)
* Add dynamicOperations option to okhttp gen

* Add tests

* Add apiclient tests

* Fix apiclient template

* Add dependencies in gradle and sbt
2020-12-10 18:22:39 +08:00
William Cheng
61777b4a7c
Revise wordings for options (#8127)
* revise wordings for options

* update
2020-12-09 10:42:54 +08:00
Jim Schubert
d854c89272
[docs] Add clarity around configuration options (#7547) 2020-09-30 20:56:28 -04:00
Jason Lee
1a709a731b
[Java] add cli option to ignore anyOf in enum (#4498)
Co-authored-by: Jim Schubert <james.schubert@gmail.com>
2020-09-12 18:09:39 -04: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
Aljaž Pavišič
c19350b179
Support for KumuluzEE microprofile runtime (#5944)
* Added library and edited generator to support server stub generation with Kumuluzee framework.

* Trimmed and tweaked pom.xml template and removed unnecessary template files from generator and library.

* minor edits

* Added new library to Java client codegen (microprofile-kumuluzee). A
functional KumuluzEE REST client can now be generated.

* Edited README for microprofile-kumuluzee

* Edited docs to include new KumuluzEE library options.

* Updated kee-rest-client client POM dependency version to latest

* fixed pom, edited REAMDE

* Trimmed redundant dependencies from KEE client pom

* Removed unnecessary DefaultGenerator edit, modified config template accordingly.

* Made mp framework an additional property for microprofile instead of being another library option, removed now redundant library files.

* Updated documentation with microprofile framework

* Fixed errors caused by removed functions and variables

* update doc

Co-authored-by: Chuckledog <aljaz.pavsic@gmail.com>
Co-authored-by: Jan Meznaric <jmezna@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-08-20 10:25:05 +08:00
William Cheng
e9c231b50a
rollback feign version to 10.11 (#7012) 2020-07-22 21:21:11 +08:00
Moshe Elisha
0a394bc883
[Java][RestTemplate] Use abstraction for files (#6912)
* Fix dir path in PR request template

* Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715)

* Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715)

* Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed (#6715)

* #6715 - Add "useAbstractionForFiles" config option for Java/RestTemplate to allow flexible options in generated client when a file is needed.
2020-07-20 22:54:14 +08:00
Yuriy Belenko
f11b0f886e
Add Mock Server client modification feature (#6747) 2020-07-05 16:58:43 -04:00
William Cheng
fa97333a5c
[Java] Deprecate feignVersion option (#6824)
* deprecate feign option

* update doc

* udpate samples
2020-07-02 00:12:32 +08:00
William Cheng
6f2e84db04
Decommission Retrofit play24, play25 (#6665)
* deco play24, play25 in retrofit

* update pom.xml

* update doc
2020-06-16 10:31:23 +08:00
James Gilliland
6f5ec7deef
Fix table layout for additionalProperties property (#6563) 2020-06-15 09:24:35 +08:00
William Cheng
a4e42e1651
[Java][Retrofit2] deprecate RxJava 1.x (#6641)
* deprecate rxjava1.x

* update samples
2020-06-13 14:30:22 +08:00
William Cheng
b049a5d466 update doc 2020-06-12 17:59:01 +08:00
tgerth
146bfeb6d6
[JAVA] RxJava3 support (#6622)
* rx3 support

* ran the shell script ./bin/generate-samples.sht

* added missing rx3 migration, removed tabs
2020-06-12 17:23:42 +08:00
Sebastien Rosset
f7f41410e7
[codegen][python-experimental] Composed schema with additionalProperties (#6290)
* Mustache template should use invokerPackage tag to generate import

* Add a unit test for allOf and additionalProperties

* Fix getAdditionalProperties

* Add code comments

* Add code comments

* set nullable for additionalproperties

* add variants of additionalProperties

* Add more unit tests

* Handle additionalProperties for composed schemas

* improve code comments

* Add code comments

* Add code comments

* Add code comments

* Add code comments

* Add code comments

* Add assertions in unit tests

* Add new property to support the 'additionalProperties' keyword with composed schemas

* run sample scripts

* fix unit tests to handle additionalProperties

* Handle additional properties and composed schema

* Handle additional properties and composed schema

* Add support for additionalProperties and composed schema

* Format java code

* Add more unit tests for Python

* Handle reference in additionalProperty keyword

* Handle reference in additionalProperty keyword

* Add use case for additionalProperties and reference

* run sample scripts

* resolve schema reference

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Add OpenAPI argument

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* Handle additional property keyword with reference

* add additionalproperties attribute with boolean values

* Run sample scripts

* handle additional properties

* Handle additionalProperties boolean values

* Run sample scripts

* fix javadoc issues

* fix javadoc issues

* Add Locale to String.toLowerCase

* execute sample scripts

* handle additional properties

* Add code comments

* Handle imports of referenced models in additional properties

* Handle isNullable class

* handle nullable type

* improve documentation, run sample scripts

* improve documentation, run sample scripts

* execute sample scripts

* execute sample scripts

* Execute sample scripts

* Run samples scripts

* set legacyAdditionalPropertiesBehavior to true by default, except python

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* create separate yaml file to avoid having lots of changes in the pr

* Change name of CLI option

* Generate doc

* Add TODO statement

* add code comments

* run samples scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* refactor cli option for additional properties

* refactor cli option for additional properties

* run samples scripts

* run sample scripts

* run sample scripts

* run sample scripts

* run sample scripts

* Add yaml comments

* small refactor

* small refactor

* run sample scripts

* run sample scripts

* fix unit tests

* Set disallowAdditionalPropertiesIfNotPresent flag

* reduced size of test yaml file

* simplify code and add imports directly

* rename some of the properties used in tests

* Handle more scenarios for nullable types

* add code comments

* Adds *args input to __init__ method to fix test testFruitNullValue

* Resolve merge issues

* run samples scripts

* run doc generator

* fix merge conflicts

Co-authored-by: Justin Black <justin.a.black@gmail.com>
2020-05-29 00:40:48 +08:00
William Cheng
07647b1a31
[Java] Decommission Retrofit 1.x support (#6447)
* decommission retrofit 1.x support

* remove retrofit 1.x from pom.xml
2020-05-28 21:43:38 +08:00
Januson
c49d8fda8e
[M][REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists (#5466)
* [REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists
 - Update Java code generation to use sets instead of lists when uniqueItems is set to true
 - Add import resolution for sets
 - Add tests and fix broke tests

resolve #5254

* Update Javascript, Perl, Python and Ruby to preserve current functionality.

* Switch set implementation to LinkedHashSet

* Fix missing import for uniqueItems used on param.

* Fix missing import and return type for responses with uniqueItems

* Fix default values for array of enum

* Update generated samples

* fix merge issue

* Update generated samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-05-21 13:27:57 +08:00
William Cheng
a5b410993b
Set java8 to true by default (#6278)
* set java8 to true by default

* update samples

* update java-petstore-jersey2-java6.bat
2020-05-13 17:59:22 +08:00
William Cheng
deec5da8a7
[Java][jersey2] replace jersey2 with jersey2-experimental (#6251)
* replace jersey2 with jersey2-experimental

* better handling of oauth

* add jersey2 java8 samples

* add dependency to test pom

* fix test, update doc
2020-05-12 18:27:33 +08:00