56 Commits

Author SHA1 Message Date
DielN
b9f6fe6b1f
[Java] [Microprofile] Add Json-B polymorphism type info annotations (#20164)
* [Microprofile] Add Json-B polymorphism annotations

* [Microprofile] Set openApiNullable in configs to false

* [Microprofile] Bump JSON Bind version to 3.0

* [Microprofile] Only apply JSON-B polymorphism for MP 3.0

* Update samples

* [Microprofile] Update documentation/configs for openApiNullable

* Update docs
2024-12-03 12:02:54 +08:00
William Cheng
711e53a90c
[Java] Add option to fallback to legacy enum naming (#20172)
* add option to fallback legacy enum naming (java)

* fix tests
2024-11-29 17:12:12 +08:00
Rodrigo de Almeida - RMA3
21d3cfe924
Fix Issue 18224 - Load x-field-extra-annotation in the operation parameter (#18967)
* fix issue 18959

* fix issue 18224

* fix issue 18224

* fix spaces

---------

Co-authored-by: Rodrigo Maciel de Almeida <rodrigo.almeida@wefin.com.br>
2024-06-30 16:27:14 +08:00
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
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
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
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
William Cheng
6a8039c672 update doc 2023-08-09 14:38:56 +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
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
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
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
Oleh Kurpiak
95b566a3a9
[Java] fix additional annotations for oneOf interfaces (#13958) 2022-11-20 12:44:47 +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
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
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
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
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
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
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
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
Yuriy Belenko
f11b0f886e
Add Mock Server client modification feature (#6747) 2020-07-05 16:58:43 -04:00
James Gilliland
6f5ec7deef
Fix table layout for additionalProperties property (#6563) 2020-06-15 09:24:35 +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
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
Justin Black
a2b613c1b3
Fixes md docs (#6079)
* Fixes md docs

* Separates out boolean enum options into legacyDiscriminatorBehaviorOpts

* Updates docs, adds true and false descriptions
2020-04-28 22:30:56 +08:00
Justin Black
8e8471c1fd
[CORE] Fixes composed schema discriminator map (#4906)
* Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap

* Requires that discriminators be required properties

* Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples

* Adds oneOf and anyOf invalidDiscriminator tests

* Updates incorrect addOneOfInterfaceModel invocation

* Runs ensure-up-to-date

* Adds updates from Sebastien Rosset

* Removes newlines

* Uses df.isString

* Fixes tests be correctly setting df.isString

* Updates discriminatorExplicitMappingVerbose description per PR feedback

* Adds description of how mappedModels is populated

* Adds the suggestion exception raising when a MappedModel mappingName is null

* Actually resolves merge conflicts

* Switches two methods to package private because they are needed for testing

* Allow nulls in MappedModel.getMappingName

* Updates CLI flag name to legacyDiscriminatorBehavior, default=true

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-04-25 00:01:02 +08:00
Sebastien Rosset
8af6b7459c
[Java] Discriminator lookup should not be case insensitive by default (#5894)
* Add 'discriminatorCaseSensitive' property

* Discriminator value lookup should not be case insensitive

* fix typo

* run scripts

* execute ./bin/utils/export_docs_generators.sh

* fix discriminator mapping, add code comments
2020-04-13 18:54:00 +08:00
Jim Schubert
aa7cd4f5af
[docs] Upgrade to Docusaurus 2 (#5271)
* [docs] Upgrade to Docusaurus 2

Due to formatting issues with Docusaurus 1 and code blocks, and upcoming
4.3 and 5.0 releases, this is an upgrade to have more control over
formatting and other functionality.

This adds behavior to have light/dark themes.

As a consequence of upgrading, columnar format on ul element in
generated generator docs had to be moved to css. This will not impact
users viewing the markdown on GitHub because it didn't display the
column format.

This upgrade should improve syntax highlighting and performance.

* Fix user page layout, choose theme with clear diff colors
2020-02-11 21:22:58 +08:00