20229 Commits

Author SHA1 Message Date
William Cheng
34265e52b1
add rule to skip xUnit1031 (#16804) 2023-10-12 15:56:27 +08:00
devhl-labs
2cfce7cd2d
version bump (#16657) 2023-10-11 16:16:06 +08:00
Valerio Santinelli
e3958cba75
Added support to skip creation of go.mod and go.sum in the Go client generator (#16766)
This adds support to avoid generating go.mod and go.sum for Go client.

By default it is set to true to keep compatibility with previous version
of the tool.

It can be set to false using --additional-properties=withGoMod=false
2023-10-11 16:00:19 +08:00
William Cheng
fe55938363
better NPE handling, log warn for const in 3.1 (#16786) 2023-10-11 15:58:29 +08:00
William Cheng
015f000f70
add mapping options to zapier client generator (#16785) 2023-10-11 15:18:45 +08:00
Robert Schweizer
384ff941ae
fix: Merge conflict from #16779 and #16777 (#16784) 2023-10-11 15:14:01 +08:00
Robert Schweizer
2b6b3b0883
[python] Do not pydantic-validate function args twice (#16776)
* refactor: Use newlines in _with_http_info call

This prevents too-long lines and matches the style that
black would enforce.

* fix: Do not pydantic-validate function args twice

Closes #15757
2023-10-11 13:57:52 +08:00
Emanuele Saccomandi
bbf9ccd0c0
fixed zapier objects array mapping (#16780) 2023-10-11 13:56:16 +08:00
Robert Schweizer
f180aa0eec
[python] Fix unnamed dicts with additional properties (#16779)
* test: Add two extra models for testing

* Fix unnamed dicts with additional properties

Closes #16630
2023-10-11 13:55:53 +08:00
Robert Schweizer
7af459396c
docs: Improve docstring in to_dict() method (#16777)
It was often confusing to me why this method is even there.

Also using more line breaks and matching how black would format this.
2023-10-11 13:51:37 +08:00
Ghufran Zahidi
1bbbb73690
fix ecdsa signing issue. (#16772) 2023-10-10 18:36:41 +08:00
Robert Schweizer
f03cbea971
feat: Add line breaks in Python API methods (#16770) 2023-10-10 18:32:52 +08:00
Robert Schweizer
9e07f85eb5
[python] Add tests and fix enum path parameters (#16769)
* test: Tests for enum params in path, query and header

* fix: Get enum ref values correctly in path parameters

Closes #16688

* fix java tests failure

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
2023-10-10 17:10:30 +08:00
William Cheng
7bb75f4bb4 uncomment ruby test 2023-10-10 14:58:01 +08:00
Robert Danci
87f9d53c3a
[Java][client] Fix feign classcastexception when getting headers (#16745)
* Avoid ClassCastException when getting headers (the header values are Collection<String> and not List<String>)
Delete unused classes

* Remove feign10x

* Add unit test
Refactor to avoid creating the headers map when ApiResponse is not used
2023-10-10 14:53:32 +08:00
SURAJ VASHISTA B K
494ee489ad
fixed a flaky test org.openapitools.codegen.DefaultCodegenTest.testVarsAndRequiredVarsPresent (#16751) 2023-10-10 13:31:22 +08:00
somethingvague
594308f821
Fix log statement (#16768)
The current log statement prints "%s", updating to properly include the parameter
2023-10-10 11:34:58 +08:00
William Cheng
4a17c22905
fix object serializer, update tests in php nextgen (#16764) 2023-10-10 11:31:38 +08:00
Tiago
3e9dba01ee
Fix ruby httpx test (#16765)
* fix setup of body params (may be nil)

* fix httpx adapter issues

treating DNS resolution errors as ConnectionFailed; removing multipart header set by the openapi-generated code, as it does not contain boundary, and interferes with the generation from httpx, which appropriately deals with mime-types already
2023-10-10 11:31:08 +08:00
William Cheng
23c5db602f
Update ruby httpx petstore test (#16753)
* update ruby httpx petstore test

* fix pom

* comment out ruby httpx tests
2023-10-09 15:43:21 +08:00
martin-mfg
e3db882ed4
[JAVA][KOTLIN][SPRING] upgrade dependencies (#16759)
* upgrade spring-boot-starter-parent

* upgrade springdoc and swagger-ui

* upgrade v3 swagger-annotations

* generate samples

* upgrade jackson

* fix spring cloud, remove temp comment

Putting "8" instead of "1.8" should be ok, because Spring Boot 3 requires Java 17 anyway, so it should be able to understand that 8 is the same as 1.8.

* generate samples

* upgrade JUnit 5, remove commons-io dependency, remove outdated samples/client/petstore/java/feign/feign10x/ files, generate samples

commons-io dependency was introduced in https://github.com/OpenAPITools/openapi-generator/pull/8484, but I don't see why it would be needed now or back then.

* update gson, generate samples

* update logback

* update feign

* update scribejava

* generate samples

* update httpmime

* okhttp-gson: update commons-lang & okhttp & junit-platform, remove mockito; generate samples

It seems Mockito is not used at all there.

* okhttp-gson: remove unnecessary sample files, generate sample files

* upgrade google-api-client & jersey-common, restore ClientTest, generate samples

* misc. upgrades in jersey2 and jersey3

jersey 3.1.3 is available already, but IntelliJ reports security problems in 3.1.3 and 3.1.2, so I used 3.1.1 instead.

* align some gradle&sbt files with poms, generate samples

* whitespace fix
2023-10-09 14:55:32 +08:00
William Cheng
48f454cf72
fix type, update tests in php nextgen (#16758) 2023-10-09 14:40:34 +08:00
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