19357 Commits

Author SHA1 Message Date
William Cheng
5fb6fcf9ef
[php-nextgen] minor fix to return type (#16752)
* minor fix to return type

* use returnProperty
2023-10-08 15:29:16 +08:00
Maddin
f5680019b2
fix handling with enums in object serializer (#16741) 2023-10-07 22:56:31 +08:00
William Cheng
893154d766
map set to list, add tests (#16730) 2023-10-07 21:56:02 +08:00
Ghufran Zahidi
050e463872
Print the multiple matchedTypes when multiple schema matched. (#16736)
Co-authored-by: Aanisha Mishra <aanisha.mishra05@gmail.com>
Co-authored-by: Vikrant Balyan (vvb) <vvb@cisco.com>
Co-authored-by: Vikrant Balyan <vvb@users.noreply.github.com>
Co-authored-by: Sebastien Rosset <serosset@cisco.com>
2023-10-06 16:17:48 +08:00
William Cheng
effbe8caad
Bug fixes based on report (#16728)
* bug fixes based on report

* fix
2023-10-05 13:02:05 +08:00
William Cheng
6722f1300d
add ruby httpx echo api tests (#16729) 2023-10-05 12:55:57 +08:00
Maddin
c306ca3cf2
fix invalid function is_subclass call for php-nextgen (#16712) 2023-10-05 12:34:50 +08:00
Tiago
822568b664
ruby client adapter for httpx (#16718)
* added isTyphoeus property to remove negations on isFaraday

* adding httpx support as alternative library for ruby client

* updated samples
2023-10-05 12:17:18 +08:00
dabdirb
4a0ab21ba4
[Spring] resolves #16054, resolves #15088 add vendor extension x-spring-provide-args (#16663)
* add vendor extenstion x-spring-provide-args

* add vendor extenstion x-spring-provide-args

* Revert "add vendor extenstion x-spring-provide-args"

This reverts commit 8a0cbc93eb5825651e4b97cbe83054adbaa1acce.

* catch up latest main and re-generate samples

* remove un-used import

* add vendor extenstion x-spring-provide-args (#16054,#15088)

* update  X_SPRING_PROVIDE_ARGS for better description

---------

Co-authored-by: xiangxi.chen <xiangxi.chen@cerence.com>
2023-10-05 11:11:55 +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
f5f9a7e091
Update tests for maven plugins (#16720)
* Fix swagger-annotations groupId in java examples

In Version 5.4.0 OpenApi-Generator has replaced the legacy library
which provided the `io.swagger.annotations.*` namespace (hosted at
https://mvnrepository.com/artifact/io.swagger/swagger-annotations)
with the updated project that provides `io.swagger.v3.oas.annotations.*`.

Hence, if you want to use OpenApi-Generator >= 5.4.0 you need this
package https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-annotations
which is now reflected in these example files.

* Raise jackson-databind-nullable version in example to latest v0.2.6

* Update springfox dependency to v3.x in java examples

See https://github.com/springfox/springfox#migrating-from-existing-2x-version

* fix maven plugin spring tests

---------

Co-authored-by: Philzen <philzen@riseup.net>
2023-10-04 15:59:12 +08:00
William Cheng
11771a8ccf update samples 2023-10-04 15:11:06 +08:00
Matthias Gabriel
4075a52dce
fix: Add prefix and suffix to discriminator (#16684)
Use the existing toModelName method to normalize the discriminator

Co-authored-by: Matthias Gabriel <mga@rockstar.jobs>
2023-10-03 18:46:56 +08:00
jenspopp
baf33f0537
Added {{>cookieParams}} to interface (#13911)
{{>cookieParams}} was introduced to generated classes but not for the only interface use case in #8117
2023-10-03 16:49:54 +08:00
AvivLevitski
9fd4cc1e63
[Feature] add the ability to generate apis and models in the specified folder from config.yaml (#15561)
* support the ability to create apis and models templates in specify folders using the config settings (folder)

* support the ability to create apis and models templates in specify folders using the config settings (folder)
2023-10-02 17:49:07 +08:00
William Cheng
97ee910a2c
update ruby rspec test (#16702) 2023-10-02 12:20:38 +08:00
Jonathan Ballet
cec5b8965a
python: type generated client using Self (#16693)
* python: type generated client using Self

This doesn't offer a clear win but this helps for:

* Using modern types and making the typing intent clearer
* Decreasing the need for `from __future__ import annotations`, since a
  class can now refer to itself without using its name
* Using more `cls` to automatically refer to the class, instead of
  respecifying the class name every time

Self is available from Python 3.11 and is provided in typing_extensions
(since 4.0.0) as a fallback for older versions

See: https://peps.python.org/pep-0673/
See: https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#added-in-version-400

* generate code
2023-10-01 23:31:39 +08:00
devhl-labs
bd1caf69cb
[csharp][generichost] Handle all responses (#16635)
* handle all responses

* update the readme

* build samples
2023-10-01 23:28:14 +08:00
Jorge Rodríguez Martín
ee5d9f6ad3
[Java][Spring] Fix RequestPart/RequestParam handling on multipart request in reactive stack (#16535)
* Fix requestpart in reactive

* Update samples
2023-10-01 23:23:24 +08:00
AlanCitrix
2eca00f87d
[Go] Adding response middleware (#16641)
* Add optional response middleware to go template

Also adds a request middleware which can return an error

* Re-adding newline to fix tests

* Fixing docs
2023-10-01 23:10:17 +08:00
Artem
039c1698b0
[php-symfony] Support for default scalar value of properties in model (#16605)
* Add support for default scalar value of properties in php-symfony models. Default values now returns in getter-functions

* Revert nullable type-hinting. Move default values from getter to property initialize.
Made changes in __construct:
Now value of properties rewrites only if key exist in $data array.
2023-10-01 21:32:32 +08:00
Jonathan Ballet
03781d3a93
python: remove aenum in favor of stdlib's enum (#16691)
The aenum dependency didn't provide any specific improvements over the
stdlib's enum module.
aenum also doesn't provide typing information at the moment.

This removes one dependency and will help for completing the typing of
the generated client.
2023-10-01 21:22:42 +08:00
Jonathan Ballet
56bc383dc1
python: type API client internal structures (#16692)
* In samples/openapi3/client/petstore/python, this reduces the mypy errors from 435 to 178 errors
* In samples/openapi3/client/petstore/python-aiohttp, this reduces the mypy errors from 381 to 124 errors
* In samples/client/echo_api/python, this reduces the mypy errors from 131 to 25 errors
2023-10-01 20:45:11 +08:00
William Cheng
ce4b2fe7bd
[Python] add float to reserved word list (#16689)
* add float as reserved world

* clean up

* update samples

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

Co-authored-by: Jonathan Ballet <jon@multani.info>

* update doc

* uncomment test

---------

Co-authored-by: Jonathan Ballet <jon@multani.info>
2023-10-01 20:41:54 +08:00
William Cheng
3fcf5584c6
Add tests for python client with disallowAdditionalPropertiesIfNotPresent set to true (#16690)
* add tests for python client with different option

* update samples

* update tests
2023-10-01 17:34:52 +08:00
ふぁ
c6e9a4e1ae
[python] change Private attr to Class vars (#16687)
* [python] fix TypeError

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python] update Private model attributes to Class vars

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python] rename the List of test cases to ListClass

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python] rename the List of v1 test cases to ListClass

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python] rename the List of v1-aiohttp test cases to ListClass

Signed-off-by: ふぁ <yuki@yuki0311.com>

* update samples

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
2023-10-01 16:52:23 +08:00
ふぁ
e2f249ba35
[PYTHON] generate code based on pydantic v2 (#16685)
* [python] replace validator with field_validator

* [python] replace parse_obj with model_validate

* [python] replace dict with model_dump

* [python] replace construct with model_construct

* [python] replace __fields_set__ with model_fields_set

* [python] replace __fields_set__ in the test cases with model_fields_set

* [python] replace validate_arguments with validate_call

* [python] replace max_items, min_items with max_length, min_length

* [python] replace Config class with model_config

* [python] replace allow_population_by_field_name with populate_by_name

* [python] remove {{{classname}}}_ONE_OF_SCHEMAS

* [python] update test cases

* [python] update samples

* [python] fix typos in test cases
2023-09-29 16:45:46 +08:00
Aarni Koskela
67b129fda9
python: Remove usage of six (#16675) 2023-09-28 19:26:42 +08:00
Samson
3c4561ece2
Update configuration.md (#16683)
added additional example for --additional-properties command with comma (,) seperator
2023-09-28 19:26:02 +08:00
Jonathan Ballet
04fa53b692
python: generate Pydantic v2 + typing complete code (#16624)
* python: improve type generation with more specific typing

* Annotate function parameters

* Remove unused imports

* remove unused files

* remove temporary hack

* remove lock file

* fix Annotated import

* support Python 3.7

* Regenerate code with typing-extensions

* Fix setup.py

* More Pydantic v2 compatibility

* depend on pydantic v2

* fix client_echo tests

* fix JSON serialization

* Fix references

* Skip circular dependency tests for now

* Temporarily hide the "float" property

The "float" property aliases the "float" type and completely breaks the
model: all the properties that were "float" now become the type of the
"float" property instead.

* Fix errors

* Import Literal from typing_extensions

* Fix GitHub Action workflows

* Fix Python 3.7 failure

* Fix quotes

* Apply suggestions from code review

* Fix tests

* split model imports from other modules imports

* fix workflow

* Comment the array unique items convertion, remove set translation

* Replace alias usage
2023-09-28 19:13:14 +08:00
Ivan Vasheka
af352df10f
fix: Fixes headers annotation for kotlin retrofit2 api template (#16680) 2023-09-28 19:01:36 +08:00
William Cheng
bb3096c99c
Jaxrs jersey3 server (#16676)
* Introduced Jersey3 to JavaJerseyServerCodgen and its test class

* Added date ParamConverterProvider to new jersey3 resource directory

* Copied and adjusted jaxrs-jersey2 directory to jaxrs-jersey3

* Added unit tests for Jersey2 (jakarta|javax) and jersey3 (jakarta only)

* Added Jersey3 to markdown documentation

* Added several mustache files for Jersey3

* Further adjustments in JavaJerseyServerCodegen for Jersey3

* Removed tabs from JavaJerseyServerCodegen

* Further improvements in pom and web template

* Changed to swagger-jaxrs2-servlet-initializer-v2 within the projects pom

* Changed servlet-initializer to jakarta version

* Removed tabs in JavaJerseyServerCodegenTest.java

* Removed tabs from JavaJerseyServerCodegen

* Out commented Swagger 1.x part in api.mustache (see ApiImplicitParams)

* Exchanged import of javax* by jakarta* in file verify.groovy

* Changed Parameter annotations to Schema annotations

* Added web.mustache for jersey3

According to the 'Swagger 2.X Integration and Configuration' doc at
https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Integration-and-Configuration

* Adjusted README to point to ./openapi.json instead of ./swagger.json

* Added ./bin/configs/jaxrs-jersey-jersey3.yaml as requested

* Added new jersey3 example (see ./samples/server/petstore/jaxrs/jersey3

* Corrected formParams.mustache exchanged @FormParam by QueryParam

* Resolved ModelValidationException for Map query parameter

* Improved api.mustache (layout and deprecated class instantiation )

* Updated jersey3 example under ./samples/server/petstore/jaxrs/jersey3

* fix tests

* add jeresey3 to github workflow test

* add new workflow

* remove jersey3

---------

Co-authored-by: CDerksen <christian.derksen@uni-due.de>
2023-09-28 16:53:20 +08:00
Robbert van Waveren
beb67aa74d
[JAVA] Prioritize mapped discriminators over generated (relates to issue #12777) (#15284)
* prioritize mapped discriminators over generated

* update samples with new ordering

* explain reason behind discriminator prioritization

* add new samples

* prioritize explicit mapping over any generated mappings

* update examples to reflect new logic

* update tests to reflect explicit mappings
2023-09-27 17:50:39 +08:00
William Cheng
4f8d61c05c
fix kotlin enum name (#16666) 2023-09-27 13:45:59 +08:00
Graeme Wilson
fdd179e60a
[csharp] Fix Issue #16660 System.NotImplementedException in ApiClient.cs with OAuth2 (#16661)
* Set authenticator against clientOptions instead of client

* Changes from generate-samples.sh ./bin/configs/csharp*
2023-09-26 11:28:16 +08:00
William Cheng
fce2dcbb37
[php-nextgen] Fix default value for array of items (#16654)
* fix form parameter default value

* fix only phpnextgen
2023-09-26 10:26:03 +08:00
William Cheng
6c1a937663
remove supportJava6 (#16664) 2023-09-26 10:14:36 +08:00
martin-mfg
1cff462d90
remove jersey 1 (#16646) 2023-09-26 09:10:11 +08:00
William Cheng
077744a7af
[python-pydantic-v1] various improvements (#16658)
* rename, add tests

* remove library support in python pydantic v1 codegen

* copy tests

* copy echo api tests

* update samples

* update doc

* add back library support
2023-09-25 15:59:06 +08:00
Jonathan Ballet
3b95f701e5
python: copy the current Python generator into a "pydantic v1" generator (#16656)
* Copy the current Python generator into a "pydantic v1" generator

This generator will be deprecated over time and the normal generator will
focus on Pydantic v2.

* add missing doc
2023-09-25 12:13:24 +08:00
William Cheng
d58e68f8c0 update php samples 2023-09-23 15:28:43 +08:00
Julian Vennen
d165b8879f
[php-nextgen] Use php type declarations (#16572)
* WIP: implement strict types

* Add parameter and return types to API methods

* Cleanup imports and some code, fix some phpdoc

* Add toDefaultValue override
2023-09-23 15:22:09 +08:00
Kyle Dodson
7d60a46bc7
Fix ASP.NET Core server type mappings (#16653) 2023-09-23 13:59:27 +08:00
Jonathan Ballet
e892d50075
Test with Python 3.11 (#16649) 2023-09-23 13:09:11 +08:00
martin-mfg
2ca99bdf8e
use model class for request body with additionalProperties (#16613)
* try out simple fix

* add test case

* generate samples
2023-09-23 13:07:53 +08:00
Graeme Wilson
f99002a974
[csharp] fix authorization header casing issue (#16622)
* Capitalise auth scheme irrespective of token_type capitalisation

* Changes from generate-samples.sh

* Add comment to change
2023-09-23 12:59:51 +08:00
dependabot[bot]
19d8dbc7d5
Bump s4u/setup-maven-action from 1.9.0 to 1.10.0 (#16652)
Bumps [s4u/setup-maven-action](https://github.com/s4u/setup-maven-action) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/s4u/setup-maven-action/releases)
- [Commits](https://github.com/s4u/setup-maven-action/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: s4u/setup-maven-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-23 12:33:15 +08:00
William Cheng
7d154c988c
[kotlin-client] add spotless plugin (#16645)
* add spotless plugin to kotlin client

* add spotless plugin to kotlin client

* use 6.13.0
2023-09-23 12:32:25 +08:00
James Choi
a68eba649f
[typescript-axios]: handle explode query (#16435)
* [typescript-axios]: handle explode query

* [typescript-axios]: handle explode query based on isPrimitive

* Use `of` instead of `for...in`

* Update modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache

---------

Co-authored-by: nightspite <n16h75p173@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2023-09-22 10:07:13 +02:00